diff options
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 0affd3239d..3edf652f35 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -33,6 +33,7 @@ #include "qtextdocument.h" #include <qtextformat.h> +#include "qtextcursor_p.h" #include "qtextdocumentlayout_p.h" #include "qtextdocumentfragment.h" #include "qtextdocumentfragment_p.h" @@ -1273,7 +1274,7 @@ static bool findInBlock(const QTextBlock &block, const QString &expression, int } } //we have a hit, return the cursor for that. - *cursor = QTextCursor(block.docHandle(), block.position() + idx); + *cursor = QTextCursorPrivate::fromPosition(block.docHandle(), block.position() + idx); cursor->setPosition(cursor->position() + expression.length(), QTextCursor::KeepAnchor); return true; } @@ -1391,7 +1392,7 @@ static bool findInBlock(const QTextBlock &block, const QRegExp &expression, int } } //we have a hit, return the cursor for that. - *cursor = QTextCursor(block.docHandle(), block.position() + idx); + *cursor = QTextCursorPrivate::fromPosition(block.docHandle(), block.position() + idx); cursor->setPosition(cursor->position() + expr.matchedLength(), QTextCursor::KeepAnchor); return true; } @@ -1519,7 +1520,7 @@ static bool findInBlock(const QTextBlock &block, const QRegularExpression &expre } } //we have a hit, return the cursor for that. - *cursor = QTextCursor(block.docHandle(), block.position() + idx); + *cursor = QTextCursorPrivate::fromPosition(block.docHandle(), block.position() + idx); cursor->setPosition(cursor->position() + match.capturedLength(), QTextCursor::KeepAnchor); return true; } |