summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2015-09-27 01:22:42 +0200
committerSamuel Gaist <samuel.gaist@edeltech.ch>2016-08-28 15:18:55 +0000
commite52fcb7dc78c83586c813f55f087a98bae4eaa0e (patch)
treeb397eb7566d464b28275e52d03f36be4e6646dcb /src
parent2743cd54a0785b6c8d16b570643281ef61024936 (diff)
QTextDocument: fix string backward search
[ChangeLog][QtGui][QTextDocument] Fixed a bug that would return a wrong position when searching backward from the end of the document. Task-number: QTBUG-48182 Change-Id: I6e88f808a50cb840f61e7bc579e2a28c5300089d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextdocument.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 3edf652f35..6cccf417c7 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1309,7 +1309,7 @@ QTextCursor QTextDocument::find(const QString &subString, int from, FindFlags op
//do not include the character given in the position.
if (options & FindBackward) {
--pos ;
- if (pos < subString.size())
+ if (pos < 0)
return QTextCursor();
}