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>
This commit is contained in:
Jarek Kobus
2022-07-08 16:45:32 +02:00
parent 11b0cab178
commit d1c98e43b5

View File

@@ -7464,7 +7464,7 @@ QMimeData *TextEditorWidget::createMimeDataFromSelection() const
tempCursor.setCharFormat(range.format); tempCursor.setCharFormat(range.format);
} }
} else { } else {
const int startPosition = current.position() - start.position() const int startPosition = current.position() - selectionStart
- removedCount; - removedCount;
int endPosition = startPosition + current.text().count(); int endPosition = startPosition + current.text().count();
if (current != last) if (current != last)