summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextengine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index ea61f257a2..eb31c520ed 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2916,7 +2916,8 @@ void QTextEngine::resolveAdditionalFormats() const
QTextFormatCollection *collection = formats();
- specialData->resolvedFormats.resize(layoutData->items.count());
+ specialData->resolvedFormats.clear();
+ QVector<QTextCharFormat> resolvedFormats(layoutData->items.count());
QVarLengthArray<int, 64> addFormatSortedByStart;
addFormatSortedByStart.reserve(specialData->addFormats.count());
@@ -2953,7 +2954,7 @@ void QTextEngine::resolveAdditionalFormats() const
++endIt;
}
- QTextCharFormat &format = specialData->resolvedFormats[i];
+ QTextCharFormat &format = resolvedFormats[i];
if (block.docHandle()) {
// when we have a docHandle, formatIndex might still return a valid index based
// on the preeditPosition. for all other cases, we cleared the resolved format indices
@@ -2968,6 +2969,8 @@ void QTextEngine::resolveAdditionalFormats() const
format = collection->charFormat(collection->indexForFormat(format)); // get shared copy
}
}
+
+ specialData->resolvedFormats = resolvedFormats;
}
QFixed QTextEngine::leadingSpaceWidth(const QScriptLine &line)