Skip to content

Commit 13f521e

Browse files
committed
QUnicodeTools: prefer lineBreakClass() convenience function
... where applicable Simplifies the code. In some cases, the code queries more than one property of the character, in which case we keep using qGetProp(). Amends 85899ff and 1f73d4b. Pick-to: 6.10 6.8 6.5 Change-Id: I27cc0e5607b1e730f649c9d73f05f6b1227bdd17 Reviewed-by: Mårten Nordheim <[email protected]>
1 parent fca5c36 commit 13f521e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/corelib/text/qunicodetools.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,7 @@ static void getLineBreaks(const char16_t *string, qsizetype len, QCharAttributes
781781
if (QChar::isLowSurrogate(low))
782782
c = QChar::surrogateToUcs4(c, low);
783783
}
784-
nncls = QUnicodeTables::LineBreakClass(
785-
QUnicodeTables::properties(c)->lineBreakClass);
784+
nncls = QUnicodeTables::lineBreakClass(c);
786785
}
787786

788787
constexpr QUnicodeTables::LineBreakClass lb15b[] = {
@@ -879,8 +878,7 @@ static void getLineBreaks(const char16_t *string, qsizetype len, QCharAttributes
879878
if (QChar::isLowSurrogate(low))
880879
ch = QChar::surrogateToUcs4(ch, low);
881880
}
882-
if (QUnicodeTables::properties(ch)->lineBreakClass
883-
== QUnicodeTables::LineBreak_NU) {
881+
if (QUnicodeTables::lineBreakClass(ch) == QUnicodeTables::LineBreak_NU) {
884882
attributes[pos].lineBreak = true;
885883
goto next;
886884
}

0 commit comments

Comments
 (0)