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>
This commit is contained in:
parent
0f52ec8d52
commit
0ef4e6d4bf
@ -4196,7 +4196,7 @@ QByteArray QByteArray::number(double n, char format, int precision)
|
||||
{
|
||||
QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
|
||||
|
||||
switch (asciiLower(format)) {
|
||||
switch (QtMiscUtils::toAsciiLower(format)) {
|
||||
case 'f':
|
||||
form = QLocaleData::DFDecimal;
|
||||
break;
|
||||
|
@ -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;
|
||||
|
@ -45,6 +45,7 @@
|
||||
#endif
|
||||
#include "qunicodetables_p.h"
|
||||
#include <private/qstringconverter_p.h>
|
||||
#include <private/qtools_p.h>
|
||||
#include "qlocale_tools_p.h"
|
||||
#include "private/qsimd_p.h"
|
||||
#include <qnumeric.h>
|
||||
@ -130,13 +131,6 @@ inline bool qIsDigit(char ch)
|
||||
return ch >= '0' && ch <= '9';
|
||||
}
|
||||
|
||||
inline char qToLower(char ch)
|
||||
{
|
||||
if (ch >= 'A' && ch <= 'Z')
|
||||
return ch - 'A' + 'a';
|
||||
else
|
||||
return ch;
|
||||
}
|
||||
template <typename Pointer>
|
||||
char32_t foldCaseHelper(Pointer ch, Pointer start) = delete;
|
||||
|
||||
@ -6949,7 +6943,7 @@ QString QString::vasprintf(const char *cformat, va_list ap)
|
||||
flags |= QLocaleData::CapitalEorX;
|
||||
|
||||
int base = 10;
|
||||
switch (qToLower(*c)) {
|
||||
switch (QtMiscUtils::toAsciiLower(*c)) {
|
||||
case 'o':
|
||||
base = 8; break;
|
||||
case 'u':
|
||||
@ -6980,7 +6974,7 @@ QString QString::vasprintf(const char *cformat, va_list ap)
|
||||
flags |= QLocaleData::CapitalEorX;
|
||||
|
||||
QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
|
||||
switch (qToLower(*c)) {
|
||||
switch (QtMiscUtils::toAsciiLower(*c)) {
|
||||
case 'e': form = QLocaleData::DFExponent; break;
|
||||
case 'a': // not supported - decimal form used instead
|
||||
case 'f': form = QLocaleData::DFDecimal; break;
|
||||
@ -7568,7 +7562,7 @@ QString QString::number(double n, char format, int precision)
|
||||
{
|
||||
QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
|
||||
|
||||
switch (qToLower(format)) {
|
||||
switch (QtMiscUtils::toAsciiLower(format)) {
|
||||
case 'f':
|
||||
form = QLocaleData::DFDecimal;
|
||||
break;
|
||||
@ -8452,7 +8446,7 @@ QString QString::arg(double a, int fieldWidth, char format, int precision, QChar
|
||||
flags |= QLocaleData::CapitalEorX;
|
||||
|
||||
QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
|
||||
switch (qToLower(format)) {
|
||||
switch (QtMiscUtils::toAsciiLower(format)) {
|
||||
case 'f':
|
||||
form = QLocaleData::DFDecimal;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user