diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-10-24 11:54:43 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2025-10-27 18:35:04 +0100 |
| commit | 13f521e4983c7f3b4a77a4c521da1cfda992dad8 (patch) | |
| tree | 03867de53f79c70016c489cbef9070c7c028c1b3 /src/corelib/text/qunicodetools.cpp | |
| parent | fca5c3676d289b89810474f42d30bf39a8d4faeb (diff) | |
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 85899ff181984a1310cd1ad10cdb0824f1ca5118 and
1f73d4b87c153224b4eeee164269d0b313a11a8b.
Pick-to: 6.10 6.8 6.5
Change-Id: I27cc0e5607b1e730f649c9d73f05f6b1227bdd17
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qunicodetools.cpp')
| -rw-r--r-- | src/corelib/text/qunicodetools.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/text/qunicodetools.cpp b/src/corelib/text/qunicodetools.cpp index 2d0b65fcc76..432c575c695 100644 --- a/src/corelib/text/qunicodetools.cpp +++ b/src/corelib/text/qunicodetools.cpp @@ -781,8 +781,7 @@ static void getLineBreaks(const char16_t *string, qsizetype len, QCharAttributes if (QChar::isLowSurrogate(low)) c = QChar::surrogateToUcs4(c, low); } - nncls = QUnicodeTables::LineBreakClass( - QUnicodeTables::properties(c)->lineBreakClass); + nncls = QUnicodeTables::lineBreakClass(c); } constexpr QUnicodeTables::LineBreakClass lb15b[] = { @@ -879,8 +878,7 @@ static void getLineBreaks(const char16_t *string, qsizetype len, QCharAttributes if (QChar::isLowSurrogate(low)) ch = QChar::surrogateToUcs4(ch, low); } - if (QUnicodeTables::properties(ch)->lineBreakClass - == QUnicodeTables::LineBreak_NU) { + if (QUnicodeTables::lineBreakClass(ch) == QUnicodeTables::LineBreak_NU) { attributes[pos].lineBreak = true; goto next; } |
