diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-24 12:43:08 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-26 20:00:41 +0000 |
commit | cfe3ac9c653dc25ad4654387a7547dc93eb2e482 (patch) | |
tree | 18e4ac129994f863c35006a4a2fc9322e28ea461 /src/gui/text/qtextengine.cpp | |
parent | a8e3245b50e1376aa3d3f2397ab10ecd5d6e6092 (diff) |
Set dontPrint flag for the respective glyph
The str_pos variable hasn't been incremented prior to string[str_pos].
Ouch!
Change-Id: I54a160c26e23821037bf6ee8aea3e0a94a5e71f9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 076b6bbde4..0841afe1b8 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1201,20 +1201,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st uint cluster = infos->cluster; if (Q_LIKELY(last_cluster != cluster)) { - if (Q_UNLIKELY(g.glyphs[i] == 0)) { - // hide characters that should normally be invisible - switch (string[item_pos + str_pos]) { - case QChar::LineFeed: - case 0x000c: // FormFeed - case QChar::CarriageReturn: - case QChar::LineSeparator: - case QChar::ParagraphSeparator: - g.attributes[i].dontPrint = true; - break; - default: - break; - } - } + g.attributes[i].clusterStart = true; // fix up clusters so that the cluster indices will be monotonic // and thus we never return out-of-order indices @@ -1222,7 +1209,19 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st log_clusters[str_pos++] = last_glyph_pos; last_glyph_pos = i + glyphs_shaped; last_cluster = cluster; - g.attributes[i].clusterStart = true; + + // hide characters that should normally be invisible + switch (string[item_pos + str_pos]) { + case QChar::LineFeed: + case 0x000c: // FormFeed + case QChar::CarriageReturn: + case QChar::LineSeparator: + case QChar::ParagraphSeparator: + g.attributes[i].dontPrint = true; + break; + default: + break; + } } } while (str_pos < item_length) |