From f439df7893d133261325aa19e6c8b64b41eb0042 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 29 May 2020 09:55:45 +0200 Subject: Set the dontPrint attribute correctly for the character being checked This amends 36325f9d86249a4f17f7efbbc1122c462708d909 so that the dontPrint attribute is set before incrementing i Change-Id: I0be7386253d8607596489ce1025d2f3f8d468ab4 Pick-to: 5.15 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 3842b775f9..c6054d3114 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1525,10 +1525,10 @@ void QTextEngine::shapeText(int item) const if (QChar::isHighSurrogate(string[i]) && i + 1 < itemLength && QChar::isLowSurrogate(string[i + 1])) { + initialGlyphs.attributes[glyph_pos].dontPrint = !QChar::isPrint(QChar::surrogateToUcs4(string[i], string[i + 1])); ++i; log_clusters[i] = glyph_pos; - initialGlyphs.attributes[glyph_pos].dontPrint = !QChar::isPrint(QChar::surrogateToUcs4(string[i], string[i + 1])); } else { initialGlyphs.attributes[glyph_pos].dontPrint = !QChar::isPrint(string[i]); } -- cgit v1.2.3