summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextengine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 448907b4fe..a07c562aca 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2723,8 +2723,10 @@ void QTextEngine::resolveAdditionalFormats() const
QVarLengthArray<int, 64> addFormatSortedByStart;
addFormatSortedByStart.reserve(specialData->addFormats.count());
- for (int i = 0; i < specialData->addFormats.count(); ++i)
- addFormatSortedByStart.append(i);
+ for (int i = 0; i < specialData->addFormats.count(); ++i) {
+ if (specialData->addFormats.at(i).length >= 0)
+ addFormatSortedByStart.append(i);
+ }
QVarLengthArray<int, 64> addFormatSortedByEnd = addFormatSortedByStart;
qSort(addFormatSortedByStart.begin(), addFormatSortedByStart.end(),
FormatRangeComparatorByStart(specialData->addFormats));