summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
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;