summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2014-02-15 09:35:34 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-17 16:43:58 +0100
commit8e57ad1a270df164cebcac7b0e2923eac6df9e37 (patch)
tree422570c08d20ac28d677293246d4ec547b431480 /src/gui
parent70f4bf1a487aa56e9667b92f420926e353ba7862 (diff)
Respect the QTextBlock's character formats in itemization
This fixes regression introduced in f864bdaf592412 (in resolveAdditionalFormats(), formatIndex(si) returned an invalid block format index due to non-empty specialData->resolvedFormats) Task-number: QTBUG-36759 Change-Id: I4da13d2edaf1987bcd85b2ef326e9d22345eb8f3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui')
-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)