summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2014-03-15 01:20:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 16:27:55 +0100
commit4f2872c64fc1e3a5a0fd58a94c521f4b128f4a5c (patch)
treef07aed2e25c5ce7866b94147ca926c39220ab36e
parent946c0925548adca627ef6c41b8e73e46cc48dbce (diff)
Make QTextEngine::setAdditionalFormats() invalidate cached results
...which ensures we're not getting the formatting/rendering artefacts in case of QStackTextEngine. Change-Id: Ia0696a3e67eb866cf9776c6649c43775944edd1d Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/gui/text/qtextengine.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 0298adde7a..3b079b7ee3 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2374,6 +2374,7 @@ void QTextEngine::freeMemory()
layoutData->hasBidi = false;
layoutData->layoutState = LayoutEmpty;
layoutData->haveCharAttributes = false;
+ layoutData->items.clear();
}
for (int i = 0; i < lines.size(); ++i) {
lines[i].justified = 0;
@@ -2520,7 +2521,8 @@ void QTextEngine::setAdditionalFormats(const QList<QTextLayout::FormatRange> &fo
specialData->addFormats = formatList;
indexAdditionalFormats();
}
- resetFontEngineCache();
+ invalidate();
+ clearLineData();
}
void QTextEngine::indexAdditionalFormats()