qt5base-lts/tests/auto/gui/text/qtextlayout
Eskil Abrahamsen Blomfeldt 7eae50a52d Fix assert on justification of QTextLine with only spaces
In the justification code, we unconditionally subtracted one
from the line_length, but then compared the result to 0 afterwards,
so we did not support when the line_length is 0 initially, which
can happen if it only consists of spaces (in which case
trailingSpaces will be non-zero and line_length will be zero.)
The fix is to bail out for both strings of length 1 and length 0.

[ChangeLog][Text] Fixed an assert when justifying a QTextLine
which only contains spaces.

Task-number: QTBUG-38520
Change-Id: Ib04993f47eb2f9f7fc49c4a5400f18f9682a72f2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-30 18:23:33 +02:00
..
.gitignore Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
qtextlayout.pro QtGui tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-27 03:54:42 +01:00
tst_qtextlayout.cpp Fix assert on justification of QTextLine with only spaces 2014-04-30 18:23:33 +02:00