Fix decorated text in extra-selections

Change ddef89b323 broke decorations
set using setExtraSelections(), because these decorations are
drawn with a second drawTextItem() call where numGlyphs is
set to 0. When the drawTextDecoration() call was moved into
the branches for multi/no-multi font engines, the call for
the cut-off when numGlyphs == 0 was unintentionally removed.

Task-number: QTBUG-54626
Change-Id: Ieb9fc23099a9d7daf87cc364d3fc9da128ec516d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2016-10-24 10:19:59 +02:00
parent 398d67198c
commit cc30177a69

View File

@ -6439,7 +6439,8 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
updateState(state);
if (!ti.glyphs.numGlyphs) {
// nothing to do
drawTextItemDecoration(q, p, ti.fontEngine, textEngine, ti.underlineStyle,
ti.flags, ti.width.toReal(), ti.charFormat);
} else if (ti.fontEngine->type() == QFontEngine::Multi) {
QFontEngineMulti *multi = static_cast<QFontEngineMulti *>(ti.fontEngine);