summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/text/qunicodetools.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/corelib/text/qunicodetools.cpp b/src/corelib/text/qunicodetools.cpp
index 46e9740f3b..32e791563f 100644
--- a/src/corelib/text/qunicodetools.cpp
+++ b/src/corelib/text/qunicodetools.cpp
@@ -20,7 +20,12 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
-Q_AUTOTEST_EXPORT int qt_initcharattributes_default_algorithm_only = 0;
+#ifdef QT_BUILD_INTERNAL
+Q_CONSTINIT Q_AUTOTEST_EXPORT
+#else
+constexpr
+#endif
+int qt_initcharattributes_default_algorithm_only = 0;
namespace QUnicodeTools {
@@ -257,7 +262,6 @@ static void getWordBreaks(const char16_t *string, qsizetype len, QCharAttributes
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
QUnicodeTables::WordBreakClass ncls = (QUnicodeTables::WordBreakClass) prop->wordBreakClass;
-#ifdef QT_BUILD_INTERNAL
if (qt_initcharattributes_default_algorithm_only) {
// as of Unicode 5.1, some punctuation marks were mapped to MidLetter and MidNumLet
// which caused "hi.there" to be treated like if it were just a single word;
@@ -268,7 +272,6 @@ static void getWordBreaks(const char16_t *string, qsizetype len, QCharAttributes
else if (ucs4 == 0x003A) // COLON
ncls = QUnicodeTables::WordBreak_MidLetter;
}
-#endif
uchar action = WB::breakTable[cls][ncls];
switch (action) {