From a30912b90667368b74b006432e7de51c583da30e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 27 Feb 2024 21:16:50 -0800 Subject: [PATCH] QString::arg: apply the Qt 7 Unicode digit semantics to the bootstrap Change-Id: I01ec3c774d9943adb903fffd17b7ef0a106944ca Reviewed-by: Giuseppe D'Angelo --- src/corelib/text/qstring.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 24aa41b1ab9..fe9790403fe 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1607,7 +1607,7 @@ int QAnyStringView::compare(QAnyStringView lhs, QAnyStringView rhs, Qt::CaseSens // ### Qt 7: do not allow anything but ASCII digits // in arg()'s replacements. -#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) static bool supportUnicodeDigitValuesInArg() { static const bool result = []() { @@ -1630,7 +1630,7 @@ static bool supportUnicodeDigitValuesInArg() static int qArgDigitValue(QChar ch) noexcept { -#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) if (supportUnicodeDigitValuesInArg()) return ch.digitValue(); #endif @@ -8479,7 +8479,7 @@ QString QString::normalized(QString::NormalizationForm mode, QChar::UnicodeVersi return copy; } -#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) static void checkArgEscape(QStringView s) { // If we're in here, it means that qArgDigitValue has accepted the @@ -8553,7 +8553,7 @@ static ArgEscapeData findArgEscapes(QStringView s) // ### Qt 7: do not allow anything but ASCII digits // in arg()'s replacements. -#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) +#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) const QChar *escapeBegin = c; const QChar *escapeEnd = escapeBegin + 1; #endif @@ -8565,13 +8565,13 @@ static ArgEscapeData findArgEscapes(QStringView s) if (next_escape != -1) { escape = (10 * escape) + next_escape; ++c; -#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) +#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) ++escapeEnd; #endif } } -#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) +#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) checkArgEscape(QStringView(escapeBegin, escapeEnd)); #endif