Implement word wrapping when pasting plain text, wrt #6

When the clipboard has plain text data copied from a plain text or ASCII
text editor, pasting the text will perform word wrapping.

The text will originate from the cursor position and subsequent lines will
by default start from column 1 to provide room for alphanumeric colour
control codes in column 0.

If the cursor is at column 0 then all lines will start at column 0.

If a box selection is dragged before pasting the text will originate at
the top left of the selection box and be confined to the box. This can be
used if the second and subsequent lines need to start at a different
column, or if the pasted text must not overwrite an existing feature at
the right side of the page.

Note that cutting or copying text from within QTeletextMaker itself will
not be word wrapped on paste.
This commit is contained in:
G.K.MacGregor
2022-11-20 17:36:53 +00:00
parent 213eace512
commit 72a2ef9660
2 changed files with 141 additions and 25 deletions

View File

@@ -179,7 +179,7 @@ private:
int m_pasteTopRow, m_pasteBottomRow, m_pasteLeftColumn, m_pasteRightColumn;
int m_clipboardDataHeight, m_clipboardDataWidth;
int m_selectionCornerRow, m_selectionCornerColumn;
bool m_selectionActive;
bool m_selectionActive, m_plainText;
};
#endif // !QT_NO_CLIPBOARD