summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2013-10-08 13:26:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-09 13:52:58 +0200
commitd4b30757ab2f66e351a73f087b834d578d21ea15 (patch)
tree79a3701e34dbe4708d4b66df5f1db8433dfa8386
parent96a11284f20312845a214df14b470f999d1e3c11 (diff)
Fix broken text layout with ShowLineAndParagraphSeparators
Before we add the current cluster we need to check if there's space for it. Calling checkFullOtherwiseExtend() also has the side effect of resetting the space data. We would add the cluster without checking for space when showing separators, causing broken behavior like we would count the space in the current item as trailing space, which would make us chop the end of the string. Task-number: QTBUG-28832 Change-Id: I8169662218ff6e645575d4e89a57f6b234f3c4cb Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/gui/text/qtextlayout.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index e10a7dbe10..dc8ae06868 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1788,6 +1788,9 @@ void QTextLine::layout_helper(int maxGlyphs)
if (!line.length && !lbh.tmpData.length)
line.setDefaultHeight(eng);
if (eng->option.flags() & QTextOption::ShowLineAndParagraphSeparators) {
+ if (lbh.checkFullOtherwiseExtend(line))
+ goto found;
+
addNextCluster(lbh.currentPosition, end, lbh.tmpData, lbh.glyphCount,
current, lbh.logClusters, lbh.glyphs);
} else {