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:
parent
a8e3245b50
commit
cfe3ac9c65
@ -1201,20 +1201,7 @@ 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;
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix up clusters so that the cluster indices will be monotonic
|
// fix up clusters so that the cluster indices will be monotonic
|
||||||
// and thus we never return out-of-order indices
|
// 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;
|
log_clusters[str_pos++] = last_glyph_pos;
|
||||||
last_glyph_pos = i + glyphs_shaped;
|
last_glyph_pos = i + glyphs_shaped;
|
||||||
last_cluster = cluster;
|
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)
|
while (str_pos < item_length)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user