From d1c98e43b51356b4d8709821d8e284a1266f43be Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 8 Jul 2022 16:45:32 +0200 Subject: [PATCH] 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 --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)