Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix infinite loop in QTextLayout with setNumColumns()
If the line width is negative, then we might exit the layout loop before consuming any text, and thus the loop will never finish. This is a side effect of a change for maximumWidth: 991c056. 49a63d3 fixed this issue for QTextLayout::setFixedSize(), but I forgot to do the same in the overload of QTextLayout::setNumColumns() which includes an alignment width and therefore sets the line width in addition to the column count. Basically, we just make sure the line width is never negative so that the width > line.width condition also means the width > 0. Pick-to: 6.6 6.5 Fixes: QTBUG-115459 Change-Id: If904bfc64cd74e819a0864db55fa9555073d0781 Reviewed-by: Vladimir Belyavsky <[email protected]> Reviewed-by: Lars Knoll <[email protected]> (cherry picked from commit be6c651) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
- Loading branch information