aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-07-08 16:45:32 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-07-13 07:23:07 +0000
commitd1c98e43b51356b4d8709821d8e284a1266f43be (patch)
treea7d99f0d30e31d33dacab5a2c43fa5f2916cdc7a
parent11b0cab178e0d549d925acda08dad4575aa7e4e4 (diff)
TextEditorWidget: Fix createMimeDataFromSelection()
When omitting separator lines take the selection start position instead of the position of the block where selection starts. Amends c98bd449523dc05f8875e96d06cf7c21e18eef0d Fixes: QTCREATORBUG-27813 Change-Id: I6067a3ef6396d50162d8e253fe4a825d47d326b9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/plugins/texteditor/texteditor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index 9a4b997ffc2..b5f5a6e4cb9 100644
--- a/src/plugins/texteditor/texteditor.cpp
+++ b/src/plugins/texteditor/texteditor.cpp
@@ -7464,7 +7464,7 @@ QMimeData *TextEditorWidget::createMimeDataFromSelection() const
tempCursor.setCharFormat(range.format);
}
} else {
- const int startPosition = current.position() - start.position()
+ const int startPosition = current.position() - selectionStart
- removedCount;
int endPosition = startPosition + current.text().count();
if (current != last)