Copy&Paste issue with lines of text

  • Not sure if ive missed an option for this or not seen a similar issue here but

    But when a user moves the cursor to the beginning of a line of text then press Ctrl Shift END to select all the text in that line and press control C after that the copied text does not end up in the clipboard.


    *Edit*

    Pressing shift and down to highlight the text and copy does not copy the text either.

    Pressing HOME on the line then ctrl shift END does not copy

    All of these no copies will work if you move the cursor in one character then press ctrl shift end does work, seems to only happen with the cursor at the very beginning of a line of text

  • I have no shortcuts assigned to CTRL C. But that shouldn't change whether it worked sometimes or not, it would always fail.

    It appears that the method of selection is what is causing the problem, not the actual copytoclipboard. Almost like the rtf doesn't recognize the current seltext if you use shift and arrows to make the selection.


    In the cases with my users, the previously copied text is still in the clipboard buffer indicating that nothing in the current copy was actually loaded.

  • Zitat von wpsupport

    Hi,

    I can copy in this cases - are you sure Ctrl+C is not overruled by a shortcut in the menu?

    Julian


    No there is no overriding control C. :(


    ive just ran a couple more tests and found that this appears to happen when the typist types to the end of the line and cursor moves to the next line down.

    Lines that a re short of the far right hand margin will copy fine but wont if the word is wrapped to the next line down

  • Ok, was very easily able to reproduce this in the 5.48(47.5) Wordpad5 demo.

    Run the demo app.
    Type in words until the line wraps down to the next line and type in a few more words.

    Like this:
    This is a test. This is a test. This is a test. This is
    a test.

    Now, move the cursor to the front of the first letter in the first line. Hold down shift and press the down arrow ONCE. The first line will highlight and the cursor will move to the start of the second line but NONE of the second line will be selected. Press control C to copy. Move farther down the page and paste. Please also note that you CAN also reproduce this using the mouse to select the text. The trick is to get the first line selected and only the cursor on the second line with no text selected. With the mouse you have to play with it to get it to that state, but it's easy, and produce the same problem.

    You can see that either nothing will paste if your clipboard was empty or they current content of the clipboard will be pasted. When copying in this method, nothing is copied to the clipboard. Selecting the entire block of text, even with the keyboard, works fine. In my own app, clicking the copy button produced the same results with the selection method used above.

    There is clearly some issue with the default copy function when the selected text is in a certain state.

    • Offizieller Beitrag

    Here is the fix - please update WPCtrMemo

    Code
    function TWPCustomRtfEdit.IsSelected: Boolean;
    begin
      Result := ((Memo.Cursor.block_s_par <> nil) and (Memo.Cursor.block_e_par <> nil)) or (Memo.Cursor.parblock_count > 0);
      if Result and (Memo.Cursor.block_s_par = Memo.Cursor.block_e_par) and
        (Memo.Cursor.block_s_posinpar = Memo.Cursor.block_e_posinpar) then Result := FALSE;
    end;