From bacbf1fcf35afcece74270fda5521d43b039ee48 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 20 Sep 2013 16:22:12 +0200 Subject: 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 --- src/gui/text/qtextengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gui/text/qtextengine.cpp') 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; -- cgit v1.2.3