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>
This commit is contained in:
Konstantin Ritt 2015-03-24 12:43:08 +04:00
parent a8e3245b50
commit cfe3ac9c65

View File

@ -1201,7 +1201,15 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
uint cluster = infos->cluster; uint cluster = infos->cluster;
if (Q_LIKELY(last_cluster != cluster)) { if (Q_LIKELY(last_cluster != cluster)) {
if (Q_UNLIKELY(g.glyphs[i] == 0)) { 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
while (last_cluster++ < cluster && str_pos < item_length)
log_clusters[str_pos++] = last_glyph_pos;
last_glyph_pos = i + glyphs_shaped;
last_cluster = cluster;
// hide characters that should normally be invisible // hide characters that should normally be invisible
switch (string[item_pos + str_pos]) { switch (string[item_pos + str_pos]) {
case QChar::LineFeed: case QChar::LineFeed:
@ -1215,15 +1223,6 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
break; break;
} }
} }
// fix up clusters so that the cluster indices will be monotonic
// and thus we never return out-of-order indices
while (last_cluster++ < cluster && str_pos < item_length)
log_clusters[str_pos++] = last_glyph_pos;
last_glyph_pos = i + glyphs_shaped;
last_cluster = cluster;
g.attributes[i].clusterStart = true;
}
} }
while (str_pos < item_length) while (str_pos < item_length)
log_clusters[str_pos++] = last_glyph_pos; log_clusters[str_pos++] = last_glyph_pos;