QLocale: Clean up QLocalePrivate implementation
In Qt4 QLocalePrivate is a struct returned by a d() method. This will be unsuitable for the planned change to use ICU and may cause BIC issues. This change makes QLocalePrivate a class and creates a new struct QLocaleData to hold the data index. Further clean-ups are possible but are left for later. Change-Id: Ie316a07790f74674a3b520b735dff72695cc4060 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
feb736ef27
commit
0060b44d70
|
|
@ -2294,7 +2294,7 @@ void QTextStreamPrivate::putNumber(qulonglong number, bool negative)
|
|||
if (locale != QLocale::c())
|
||||
flags |= QLocalePrivate::ThousandsGroup;
|
||||
|
||||
const QLocalePrivate *dd = locale.d();
|
||||
const QLocalePrivate *dd = locale.d;
|
||||
int base = integerBase ? integerBase : 10;
|
||||
if (negative && base == 10) {
|
||||
result = dd->longLongToString(-static_cast<qlonglong>(number), -1,
|
||||
|
|
@ -2503,7 +2503,7 @@ QTextStream &QTextStream::operator<<(double f)
|
|||
if (numberFlags() & ForcePoint)
|
||||
flags |= QLocalePrivate::Alternate;
|
||||
|
||||
const QLocalePrivate *dd = d->locale.d();
|
||||
const QLocalePrivate *dd = d->locale.d;
|
||||
QString num = dd->doubleToString(f, d->realNumberPrecision, form, -1, flags);
|
||||
d->putString(num, true);
|
||||
return *this;
|
||||
|
|
|
|||
|
|
@ -3633,7 +3633,7 @@ QByteArray &QByteArray::setNum(qlonglong n, int base)
|
|||
}
|
||||
#endif
|
||||
QLocale locale(QLocale::C);
|
||||
*this = locale.d()->longLongToString(n, -1, base).toLatin1();
|
||||
*this = locale.d->longLongToString(n, -1, base).toLatin1();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -3652,7 +3652,7 @@ QByteArray &QByteArray::setNum(qulonglong n, int base)
|
|||
}
|
||||
#endif
|
||||
QLocale locale(QLocale::C);
|
||||
*this = locale.d()->unsLongLongToString(n, -1, base).toLatin1();
|
||||
*this = locale.d->unsLongLongToString(n, -1, base).toLatin1();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -3711,7 +3711,7 @@ QByteArray &QByteArray::setNum(double n, char f, int prec)
|
|||
}
|
||||
|
||||
QLocale locale(QLocale::C);
|
||||
*this = locale.d()->doubleToString(n, prec, form, -1, flags).toLatin1();
|
||||
*this = locale.d->doubleToString(n, prec, form, -1, flags).toLatin1();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -45,6 +45,7 @@
|
|||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qobjectdefs.h>
|
||||
#include <QtCore/qshareddata.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
|
|
@ -59,9 +60,8 @@ class QVariant;
|
|||
class QTextStream;
|
||||
class QTextStreamPrivate;
|
||||
|
||||
class QLocale;
|
||||
class QLocalePrivate;
|
||||
|
||||
struct QLocalePrivate;
|
||||
class Q_CORE_EXPORT QLocale
|
||||
{
|
||||
Q_GADGET
|
||||
|
|
@ -590,6 +590,7 @@ public:
|
|||
QLocale(Language language, Country country = AnyCountry);
|
||||
QLocale(Language language, Script script, Country country);
|
||||
QLocale(const QLocale &other);
|
||||
~QLocale();
|
||||
|
||||
QLocale &operator=(const QLocale &other);
|
||||
|
||||
|
|
@ -700,20 +701,10 @@ public:
|
|||
QString quoteString(const QStringRef &str, QuotationStyle style = StandardQuotation) const;
|
||||
|
||||
QString createSeparatedList(const QStringList &strl) const;
|
||||
//private: // this should be private, but can't be
|
||||
struct Data {
|
||||
quint16 index;
|
||||
quint16 numberOptions;
|
||||
};
|
||||
|
||||
private:
|
||||
friend struct QLocalePrivate;
|
||||
// ### We now use this field to pack an index into locale_data and NumberOptions.
|
||||
// ### Qt 5: change to a QLocaleData *d; uint numberOptions.
|
||||
union {
|
||||
void *v;
|
||||
Data p;
|
||||
};
|
||||
const QLocalePrivate *d() const;
|
||||
friend class QLocalePrivate;
|
||||
QSharedDataPointer<QLocalePrivate> d;
|
||||
};
|
||||
Q_DECLARE_TYPEINFO(QLocale, Q_MOVABLE_TYPE);
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::NumberOptions)
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ static const quint16 locale_index[] = {
|
|||
0 // trailing 0
|
||||
};
|
||||
|
||||
static const QLocalePrivate locale_data[] = {
|
||||
static const QLocaleData locale_data[] = {
|
||||
// lang script terr dec group list prcnt zero minus plus exp quotStart quotEnd altQuotStart altQuotEnd lpStart lpMid lpEnd lpTwo sDtFmt lDtFmt sTmFmt lTmFmt ssMonth slMonth sMonth lMonth sDays lDays am,len pm,len
|
||||
{ 1, 0, 0, 46, 44, 59, 37, 48, 45, 43, 101, 34, 34, 39, 39, 0,6 , 0,6 , 0,6 , 0,6 , 0,10 , 10,17 , 0,8 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 158,27 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 99,14 , 0,2 , 0,2 , {0,0,0}, 0,0 , 0,7 , 0,4 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // C/AnyScript/AnyCountry
|
||||
{ 3, 0, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 35,18 , 18,7 , 25,12 , 185,48 , 233,111 , 134,24 , 185,48 , 233,111 , 134,24 , 113,28 , 141,55 , 85,14 , 113,28 , 141,55 , 85,14 , 2,2 , 2,2 , {69,84,66}, 0,2 , 7,24 , 4,4 , 4,0 , 0,6 , 6,10 , 2, 1, 6, 6, 7 }, // Afan/AnyScript/Ethiopia
|
||||
|
|
|
|||
|
|
@ -126,20 +126,71 @@ private:
|
|||
};
|
||||
#endif
|
||||
|
||||
struct Q_CORE_EXPORT QLocalePrivate
|
||||
struct QLocaleData
|
||||
{
|
||||
public:
|
||||
QChar decimal() const { return QChar(m_decimal); }
|
||||
QChar group() const { return QChar(m_group); }
|
||||
QChar list() const { return QChar(m_list); }
|
||||
QChar percent() const { return QChar(m_percent); }
|
||||
QChar zero() const { return QChar(m_zero); }
|
||||
QChar plus() const { return QChar(m_plus); }
|
||||
QChar minus() const { return QChar(m_minus); }
|
||||
QChar exponential() const { return QChar(m_exponential); }
|
||||
static const QLocaleData *findLocaleData(QLocale::Language language,
|
||||
QLocale::Script script,
|
||||
QLocale::Country country);
|
||||
|
||||
quint16 languageId() const { return m_language_id; }
|
||||
quint16 countryId() const { return m_country_id; }
|
||||
quint16 m_language_id, m_script_id, m_country_id;
|
||||
|
||||
quint16 m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential;
|
||||
quint16 m_quotation_start, m_quotation_end;
|
||||
quint16 m_alternate_quotation_start, m_alternate_quotation_end;
|
||||
|
||||
quint16 m_list_pattern_part_start_idx, m_list_pattern_part_start_size;
|
||||
quint16 m_list_pattern_part_mid_idx, m_list_pattern_part_mid_size;
|
||||
quint16 m_list_pattern_part_end_idx, m_list_pattern_part_end_size;
|
||||
quint16 m_list_pattern_part_two_idx, m_list_pattern_part_two_size;
|
||||
quint16 m_short_date_format_idx, m_short_date_format_size;
|
||||
quint16 m_long_date_format_idx, m_long_date_format_size;
|
||||
quint16 m_short_time_format_idx, m_short_time_format_size;
|
||||
quint16 m_long_time_format_idx, m_long_time_format_size;
|
||||
quint16 m_standalone_short_month_names_idx, m_standalone_short_month_names_size;
|
||||
quint16 m_standalone_long_month_names_idx, m_standalone_long_month_names_size;
|
||||
quint16 m_standalone_narrow_month_names_idx, m_standalone_narrow_month_names_size;
|
||||
quint16 m_short_month_names_idx, m_short_month_names_size;
|
||||
quint16 m_long_month_names_idx, m_long_month_names_size;
|
||||
quint16 m_narrow_month_names_idx, m_narrow_month_names_size;
|
||||
quint16 m_standalone_short_day_names_idx, m_standalone_short_day_names_size;
|
||||
quint16 m_standalone_long_day_names_idx, m_standalone_long_day_names_size;
|
||||
quint16 m_standalone_narrow_day_names_idx, m_standalone_narrow_day_names_size;
|
||||
quint16 m_short_day_names_idx, m_short_day_names_size;
|
||||
quint16 m_long_day_names_idx, m_long_day_names_size;
|
||||
quint16 m_narrow_day_names_idx, m_narrow_day_names_size;
|
||||
quint16 m_am_idx, m_am_size;
|
||||
quint16 m_pm_idx, m_pm_size;
|
||||
char m_currency_iso_code[3];
|
||||
quint16 m_currency_symbol_idx, m_currency_symbol_size;
|
||||
quint16 m_currency_display_name_idx, m_currency_display_name_size;
|
||||
quint8 m_currency_format_idx, m_currency_format_size;
|
||||
quint8 m_currency_negative_format_idx, m_currency_negative_format_size;
|
||||
quint16 m_language_endonym_idx, m_language_endonym_size;
|
||||
quint16 m_country_endonym_idx, m_country_endonym_size;
|
||||
quint16 m_currency_digits : 2;
|
||||
quint16 m_currency_rounding : 3;
|
||||
quint16 m_first_day_of_week : 3;
|
||||
quint16 m_weekend_start : 3;
|
||||
quint16 m_weekend_end : 3;
|
||||
};
|
||||
|
||||
class Q_CORE_EXPORT QLocalePrivate : public QSharedData
|
||||
{
|
||||
public:
|
||||
QLocalePrivate() : m_index(0), m_numberOptions(0), m_data(0) {}
|
||||
|
||||
QChar decimal() const { return QChar(m_data->m_decimal); }
|
||||
QChar group() const { return QChar(m_data->m_group); }
|
||||
QChar list() const { return QChar(m_data->m_list); }
|
||||
QChar percent() const { return QChar(m_data->m_percent); }
|
||||
QChar zero() const { return QChar(m_data->m_zero); }
|
||||
QChar plus() const { return QChar(m_data->m_plus); }
|
||||
QChar minus() const { return QChar(m_data->m_minus); }
|
||||
QChar exponential() const { return QChar(m_data->m_exponential); }
|
||||
|
||||
quint16 languageId() const { return m_data->m_language_id; }
|
||||
quint16 countryId() const { return m_data->m_country_id; }
|
||||
|
||||
QString bcp47Name() const;
|
||||
|
||||
|
|
@ -152,10 +203,6 @@ public:
|
|||
static QLocale::Country codeToCountry(const QString &code);
|
||||
static void getLangAndCountry(const QString &name, QLocale::Language &lang,
|
||||
QLocale::Script &script, QLocale::Country &cntry);
|
||||
static const QLocalePrivate *findLocale(QLocale::Language language,
|
||||
QLocale::Script script,
|
||||
QLocale::Country country);
|
||||
|
||||
|
||||
QLocale::MeasurementSystem measurementSystem() const;
|
||||
|
||||
|
|
@ -238,48 +285,11 @@ public:
|
|||
QString dateTimeToString(const QString &format, const QDate *date, const QTime *time,
|
||||
const QLocale *q) const;
|
||||
|
||||
quint16 m_language_id, m_script_id, m_country_id;
|
||||
|
||||
quint16 m_decimal, m_group, m_list, m_percent,
|
||||
m_zero, m_minus, m_plus, m_exponential;
|
||||
quint16 m_quotation_start, m_quotation_end;
|
||||
quint16 m_alternate_quotation_start, m_alternate_quotation_end;
|
||||
|
||||
quint16 m_list_pattern_part_start_idx, m_list_pattern_part_start_size;
|
||||
quint16 m_list_pattern_part_mid_idx, m_list_pattern_part_mid_size;
|
||||
quint16 m_list_pattern_part_end_idx, m_list_pattern_part_end_size;
|
||||
quint16 m_list_pattern_part_two_idx, m_list_pattern_part_two_size;
|
||||
quint16 m_short_date_format_idx, m_short_date_format_size;
|
||||
quint16 m_long_date_format_idx, m_long_date_format_size;
|
||||
quint16 m_short_time_format_idx, m_short_time_format_size;
|
||||
quint16 m_long_time_format_idx, m_long_time_format_size;
|
||||
quint16 m_standalone_short_month_names_idx, m_standalone_short_month_names_size;
|
||||
quint16 m_standalone_long_month_names_idx, m_standalone_long_month_names_size;
|
||||
quint16 m_standalone_narrow_month_names_idx, m_standalone_narrow_month_names_size;
|
||||
quint16 m_short_month_names_idx, m_short_month_names_size;
|
||||
quint16 m_long_month_names_idx, m_long_month_names_size;
|
||||
quint16 m_narrow_month_names_idx, m_narrow_month_names_size;
|
||||
quint16 m_standalone_short_day_names_idx, m_standalone_short_day_names_size;
|
||||
quint16 m_standalone_long_day_names_idx, m_standalone_long_day_names_size;
|
||||
quint16 m_standalone_narrow_day_names_idx, m_standalone_narrow_day_names_size;
|
||||
quint16 m_short_day_names_idx, m_short_day_names_size;
|
||||
quint16 m_long_day_names_idx, m_long_day_names_size;
|
||||
quint16 m_narrow_day_names_idx, m_narrow_day_names_size;
|
||||
quint16 m_am_idx, m_am_size;
|
||||
quint16 m_pm_idx, m_pm_size;
|
||||
char m_currency_iso_code[3];
|
||||
quint16 m_currency_symbol_idx, m_currency_symbol_size;
|
||||
quint16 m_currency_display_name_idx, m_currency_display_name_size;
|
||||
quint8 m_currency_format_idx, m_currency_format_size;
|
||||
quint8 m_currency_negative_format_idx, m_currency_negative_format_size;
|
||||
quint16 m_language_endonym_idx, m_language_endonym_size;
|
||||
quint16 m_country_endonym_idx, m_country_endonym_size;
|
||||
quint16 m_currency_digits : 2;
|
||||
quint16 m_currency_rounding : 3;
|
||||
quint16 m_first_day_of_week : 3;
|
||||
quint16 m_weekend_start : 3;
|
||||
quint16 m_weekend_end : 3;
|
||||
|
||||
private:
|
||||
friend class QLocale;
|
||||
quint16 m_index;
|
||||
quint16 m_numberOptions;
|
||||
const QLocaleData *m_data;
|
||||
};
|
||||
|
||||
inline char QLocalePrivate::digitToCLocale(QChar in) const
|
||||
|
|
|
|||
|
|
@ -5582,7 +5582,7 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
|
|||
case lm_t: i = va_arg(ap, int); break;
|
||||
default: i = 0; break;
|
||||
}
|
||||
subst = locale.d()->longLongToString(i, precision, 10, width, flags);
|
||||
subst = locale.d->longLongToString(i, precision, 10, width, flags);
|
||||
++c;
|
||||
break;
|
||||
}
|
||||
|
|
@ -5614,7 +5614,7 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
|
|||
base = 16; break;
|
||||
default: break;
|
||||
}
|
||||
subst = locale.d()->unsLongLongToString(u, precision, base, width, flags);
|
||||
subst = locale.d->unsLongLongToString(u, precision, base, width, flags);
|
||||
++c;
|
||||
break;
|
||||
}
|
||||
|
|
@ -5643,7 +5643,7 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
|
|||
case 'g': form = QLocalePrivate::DFSignificantDigits; break;
|
||||
default: break;
|
||||
}
|
||||
subst = locale.d()->doubleToString(d, precision, form, width, flags);
|
||||
subst = locale.d->doubleToString(d, precision, form, width, flags);
|
||||
++c;
|
||||
break;
|
||||
}
|
||||
|
|
@ -5677,7 +5677,7 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
|
|||
quint64 i = reinterpret_cast<unsigned long>(arg);
|
||||
#endif
|
||||
flags |= QLocalePrivate::Alternate;
|
||||
subst = locale.d()->unsLongLongToString(i, precision, 16, width, flags);
|
||||
subst = locale.d->unsLongLongToString(i, precision, 16, width, flags);
|
||||
++c;
|
||||
break;
|
||||
}
|
||||
|
|
@ -5762,7 +5762,7 @@ qint64 QString::toLongLong(bool *ok, int base) const
|
|||
#endif
|
||||
|
||||
QLocale c_locale(QLocale::C);
|
||||
return c_locale.d()->stringToLongLong(*this, base, ok, QLocalePrivate::FailOnGroupSeparators);
|
||||
return c_locale.d->stringToLongLong(*this, base, ok, QLocalePrivate::FailOnGroupSeparators);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -5797,7 +5797,7 @@ quint64 QString::toULongLong(bool *ok, int base) const
|
|||
#endif
|
||||
|
||||
QLocale c_locale(QLocale::C);
|
||||
return c_locale.d()->stringToUnsLongLong(*this, base, ok, QLocalePrivate::FailOnGroupSeparators);
|
||||
return c_locale.d->stringToUnsLongLong(*this, base, ok, QLocalePrivate::FailOnGroupSeparators);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -6036,7 +6036,7 @@ ushort QString::toUShort(bool *ok, int base) const
|
|||
double QString::toDouble(bool *ok) const
|
||||
{
|
||||
QLocale c_locale(QLocale::C);
|
||||
return c_locale.d()->stringToDouble(*this, ok, QLocalePrivate::FailOnGroupSeparators);
|
||||
return c_locale.d->stringToDouble(*this, ok, QLocalePrivate::FailOnGroupSeparators);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -6113,7 +6113,7 @@ QString &QString::setNum(qlonglong n, int base)
|
|||
}
|
||||
#endif
|
||||
QLocale locale(QLocale::C);
|
||||
*this = locale.d()->longLongToString(n, -1, base);
|
||||
*this = locale.d->longLongToString(n, -1, base);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -6129,7 +6129,7 @@ QString &QString::setNum(qulonglong n, int base)
|
|||
}
|
||||
#endif
|
||||
QLocale locale(QLocale::C);
|
||||
*this = locale.d()->unsLongLongToString(n, -1, base);
|
||||
*this = locale.d->unsLongLongToString(n, -1, base);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -6186,7 +6186,7 @@ QString &QString::setNum(double n, char f, int prec)
|
|||
}
|
||||
|
||||
QLocale locale(QLocale::C);
|
||||
*this = locale.d()->doubleToString(n, prec, form, -1, flags);
|
||||
*this = locale.d->doubleToString(n, prec, form, -1, flags);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -6984,14 +6984,14 @@ QString QString::arg(qlonglong a, int fieldWidth, int base, QChar fillChar) cons
|
|||
|
||||
QString arg;
|
||||
if (d.occurrences > d.locale_occurrences)
|
||||
arg = QLocale::c().d()->longLongToString(a, -1, base, fieldWidth, flags);
|
||||
arg = QLocale::c().d->longLongToString(a, -1, base, fieldWidth, flags);
|
||||
|
||||
QString locale_arg;
|
||||
if (d.locale_occurrences > 0) {
|
||||
QLocale locale;
|
||||
if (!locale.numberOptions() & QLocale::OmitGroupSeparator)
|
||||
flags |= QLocalePrivate::ThousandsGroup;
|
||||
locale_arg = locale.d()->longLongToString(a, -1, base, fieldWidth, flags);
|
||||
locale_arg = locale.d->longLongToString(a, -1, base, fieldWidth, flags);
|
||||
}
|
||||
|
||||
return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar);
|
||||
|
|
@ -7028,14 +7028,14 @@ QString QString::arg(qulonglong a, int fieldWidth, int base, QChar fillChar) con
|
|||
|
||||
QString arg;
|
||||
if (d.occurrences > d.locale_occurrences)
|
||||
arg = QLocale::c().d()->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
||||
arg = QLocale::c().d->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
||||
|
||||
QString locale_arg;
|
||||
if (d.locale_occurrences > 0) {
|
||||
QLocale locale;
|
||||
if (!locale.numberOptions() & QLocale::OmitGroupSeparator)
|
||||
flags |= QLocalePrivate::ThousandsGroup;
|
||||
locale_arg = locale.d()->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
||||
locale_arg = locale.d->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
||||
}
|
||||
|
||||
return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar);
|
||||
|
|
@ -7162,7 +7162,7 @@ QString QString::arg(double a, int fieldWidth, char fmt, int prec, QChar fillCha
|
|||
|
||||
QString arg;
|
||||
if (d.occurrences > d.locale_occurrences)
|
||||
arg = QLocale::c().d()->doubleToString(a, prec, form, fieldWidth, flags);
|
||||
arg = QLocale::c().d->doubleToString(a, prec, form, fieldWidth, flags);
|
||||
|
||||
QString locale_arg;
|
||||
if (d.locale_occurrences > 0) {
|
||||
|
|
@ -7170,7 +7170,7 @@ QString QString::arg(double a, int fieldWidth, char fmt, int prec, QChar fillCha
|
|||
|
||||
if (!locale.numberOptions() & QLocale::OmitGroupSeparator)
|
||||
flags |= QLocalePrivate::ThousandsGroup;
|
||||
locale_arg = locale.d()->doubleToString(a, prec, form, fieldWidth, flags);
|
||||
locale_arg = locale.d->doubleToString(a, prec, form, fieldWidth, flags);
|
||||
}
|
||||
|
||||
return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar);
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ static qlonglong pow10(int exp)
|
|||
QValidator::State QIntValidator::validate(QString & input, int&) const
|
||||
{
|
||||
QByteArray buff;
|
||||
if (!locale().d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) {
|
||||
if (!locale().d->validateChars(input, QLocalePrivate::IntegerMode, &buff)) {
|
||||
return Invalid;
|
||||
}
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ QValidator::State QIntValidator::validate(QString & input, int&) const
|
|||
void QIntValidator::fixup(QString &input) const
|
||||
{
|
||||
QByteArray buff;
|
||||
if (!locale().d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) {
|
||||
if (!locale().d->validateChars(input, QLocalePrivate::IntegerMode, &buff)) {
|
||||
return;
|
||||
}
|
||||
bool ok, overflow;
|
||||
|
|
@ -655,7 +655,7 @@ QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QL
|
|||
{
|
||||
Q_Q(const QDoubleValidator);
|
||||
QByteArray buff;
|
||||
if (!locale.d()->validateChars(input, numMode, &buff, q->dec))
|
||||
if (!locale.d->validateChars(input, numMode, &buff, q->dec))
|
||||
return QValidator::Invalid;
|
||||
|
||||
if (buff.isEmpty())
|
||||
|
|
|
|||
|
|
@ -513,7 +513,7 @@ def main():
|
|||
endonyms_data = StringData()
|
||||
|
||||
# Locale data
|
||||
data_temp_file.write("static const QLocalePrivate locale_data[] = {\n")
|
||||
data_temp_file.write("static const QLocaleData locale_data[] = {\n")
|
||||
data_temp_file.write("// lang script terr dec group list prcnt zero minus plus exp quotStart quotEnd altQuotStart altQuotEnd lpStart lpMid lpEnd lpTwo sDtFmt lDtFmt sTmFmt lTmFmt ssMonth slMonth sMonth lMonth sDays lDays am,len pm,len\n")
|
||||
|
||||
locale_keys = locale_map.keys()
|
||||
|
|
|
|||
Loading…
Reference in New Issue