From 2c04c898ab4d9f1519e334abde110b0bc5d0975b Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Sun, 23 May 2021 14:03:28 +0100 Subject: [PATCH] Handle non-Latin characters when pasting plain text --- levelonecommands.cpp | 25 +++++++++++++++++++++---- levelonecommands.h | 2 +- mainwidget.cpp | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/levelonecommands.cpp b/levelonecommands.cpp index 2bebfc6..fc16169 100644 --- a/levelonecommands.cpp +++ b/levelonecommands.cpp @@ -403,7 +403,7 @@ void CutCommand::undo() } -PasteCommand::PasteCommand(TeletextDocument *teletextDocument, QUndoCommand *parent) : LevelOneCommand(teletextDocument, parent) +PasteCommand::PasteCommand(TeletextDocument *teletextDocument, int pageCharSet, QUndoCommand *parent) : LevelOneCommand(teletextDocument, parent) { const QClipboard *clipboard = QApplication::clipboard(); const QMimeData *mimeData = clipboard->mimeData(); @@ -441,9 +441,26 @@ PasteCommand::PasteCommand(TeletextDocument *teletextDocument, QUndoCommand *par for (int r=0; rundoStack()->push(new PasteCommand(m_teletextDocument)); + m_teletextDocument->undoStack()->push(new PasteCommand(m_teletextDocument, m_pageRender.level1CharSet(m_teletextDocument->cursorRow(), m_teletextDocument->cursorColumn()))); } QPair TeletextWidget::mouseToRowAndColumn(const QPoint &mousePosition)