Core: Avoid a temporary MultiTextCursor

Change-Id: Ibe588ab34e754c9f2c6b483ab642c818b19edef7
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2024-07-11 11:03:47 +02:00
parent 6afc9b5b51
commit 58f3e06e98

View File

@@ -449,8 +449,7 @@ void BaseTextFind::defineFindScope()
for (const QTextCursor &c : multiCursor) {
if (c.hasSelection()) {
if (foundSelection || c.block() != c.document()->findBlock(c.anchor())) {
const QList<QTextCursor> sortedCursors = Utils::sorted(multiCursor.cursors());
d->m_scope = Utils::MultiTextCursor(sortedCursors);
d->m_scope = Utils::MultiTextCursor(Utils::sorted(multiCursor.cursors()));
QTextCursor cursor = textCursor();
cursor.clearSelection();
setTextCursor(cursor);