diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-17 09:11:55 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-02-19 07:29:37 +0100 |
commit | 0ef4e6d4bfdb4a783167bc0cddeeb2059183bf9b (patch) | |
tree | 3a5a1cbb124e3191ac38140aa8cd321751878aec /src/corelib/text/qlocale.cpp | |
parent | 0f52ec8d5265e23f563f91a290a60e7d8e714166 (diff) |
Use QtMiscUtils::toAsciiLower() around the code
... instead of self-rolled versions in at least three TUs.
QByteArray's asciiLower() cannot be completely removed, yet, because
it's used for indirect calls.
Change-Id: Icf4e7605184f0a1157967c78cbd7632b283c4a9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r-- | src/corelib/text/qlocale.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 7571b649f0..1811304f51 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -68,6 +68,7 @@ QT_WARNING_DISABLE_GCC("-Wfree-nonheap-object") // false positive tracking #include "qvarlengtharray.h" #include "qstringbuilder.h" #include "private/qnumeric_p.h" +#include "private/qtools_p.h" #include <cmath> #ifndef QT_NO_SYSTEMLOCALE # include "qmutex.h" @@ -2629,14 +2630,6 @@ static bool qIsUpper(char c) return c >= 'A' && c <= 'Z'; } -static char qToLower(char c) -{ - if (c >= 'A' && c <= 'Z') - return c - 'A' + 'a'; - else - return c; -} - /*! \overload Returns a string representing the floating-point number \a f. @@ -2678,7 +2671,7 @@ QString QLocale::toString(double f, char format, int precision) const QLocaleData::DoubleForm form = QLocaleData::DFDecimal; uint flags = qIsUpper(format) ? QLocaleData::CapitalEorX : 0; - switch (qToLower(format)) { + switch (QtMiscUtils::toAsciiLower(format)) { case 'f': form = QLocaleData::DFDecimal; break; |