summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-20 16:22:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-23 21:20:47 +0200
commitbacbf1fcf35afcece74270fda5521d43b039ee48 (patch)
treeced3c76a8275c976a54847e9df542077996c68f5 /src/gui/text/qtextengine.cpp
parentcc778e1d2108806ef5d14b87eddd3ce8999c27ee (diff)
Remove some qBinaryFind usages from QtGui
This is done per the mailing list discussion at http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: Iecb921cd778571d24680254566e9aa8fc8d5edff Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r--src/gui/text/qtextengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 241ed21a10..e571e8da8a 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2969,7 +2969,10 @@ void QTextEngine::resolveAdditionalFormats() const
}
while (endIt != addFormatSortedByEnd.constEnd() &&
specialData->addFormats.at(*endIt).start + specialData->addFormats.at(*endIt).length < end) {
- currentFormats.remove(qBinaryFind(currentFormats, *endIt) - currentFormats.begin());
+ int *currentFormatIterator = std::lower_bound(currentFormats.begin(), currentFormats.end(), *endIt);
+ if (*endIt < *currentFormatIterator)
+ currentFormatIterator = currentFormats.end();
+ currentFormats.remove(currentFormatIterator - currentFormats.begin());
++endIt;
}
QTextCharFormat format;