From 06f079e528bf135e5d407b15d1bd50a91ce4a888 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 25 Jul 2011 15:23:54 +0200 Subject: Reset previousGlyph once we reached a new text item The bug was introduced in fd818312. Before that, previousGlyph is only saved in the same text item. After we moved it to LineBreakHelper struct, it will cause crash if the font engine in the new text item no longer contains the sub engine required by previousGlyph. Task-number: QTBUG-20243 Reviewed-by: Eskil --- src/gui/text/qtextlayout.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 183bcea..01adecf 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1869,6 +1869,7 @@ void QTextLine::layout_helper(int maxGlyphs) lbh.currentPosition = qMax(line.from, current.position); end = current.position + eng->length(item); lbh.glyphs = eng->shapedGlyphs(¤t); + lbh.previousGlyph = 0; QFontEngine *fontEngine = eng->fontEngine(current); if (lbh.fontEngine != fontEngine) { lbh.fontEngine = fontEngine; -- cgit v0.12