summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-10-13 16:38:03 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-11-08 13:00:31 +0100
commit902a5a1ff48bf68af45d6a09fd58bcecb29add6c (patch)
treec33533f09ba901bec4b5334556421ae191bf35e4
parentcc33b977ff680498d102fa4431a40ee841b0d341 (diff)
Rename QLocalePrivate's m_data_offset to m_index
Change-Id: I1d27e6e57893c2f96df40746e1280fc8428e9ec1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
-rw-r--r--src/corelib/text/qlocale.cpp4
-rw-r--r--src/corelib/text/qlocale_p.h9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index fd6f98c821..6253766fd5 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -2700,7 +2700,7 @@ QString QCalendarBackend::monthName(const QLocale &locale, int month, int,
QLocale::FormatType format) const
{
Q_ASSERT(month >= 1 && month <= maximumMonthsInYear());
- return rawMonthName(localeMonthIndexData()[locale.d->m_data_offset],
+ return rawMonthName(localeMonthIndexData()[locale.d->m_index],
localeMonthData(), month, format);
}
@@ -2726,7 +2726,7 @@ QString QCalendarBackend::standaloneMonthName(const QLocale &locale, int month,
QLocale::FormatType format) const
{
Q_ASSERT(month >= 1 && month <= maximumMonthsInYear());
- return rawStandaloneMonthName(localeMonthIndexData()[locale.d->m_data_offset],
+ return rawStandaloneMonthName(localeMonthIndexData()[locale.d->m_index],
localeMonthData(), month, format);
}
diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h
index ec2723e493..96b4c4c4a0 100644
--- a/src/corelib/text/qlocale_p.h
+++ b/src/corelib/text/qlocale_p.h
@@ -395,13 +395,13 @@ class Q_CORE_EXPORT QLocalePrivate // A POD type
{
public:
static QLocalePrivate *create(
- const QLocaleData *data, const uint data_offset,
+ const QLocaleData *data, const uint index,
QLocale::NumberOptions numberOptions = QLocale::DefaultNumberOptions)
{
auto *retval = new QLocalePrivate;
retval->m_data = data;
retval->ref.storeRelaxed(0);
- retval->m_data_offset = data_offset;
+ retval->m_index = index;
retval->m_numberOptions = numberOptions;
return retval;
}
@@ -430,9 +430,10 @@ public:
QLocale::MeasurementSystem measurementSystem() const;
+ // System locale has an m_data all its own; all others have m_data = locale_data + m_index
const QLocaleData *m_data;
QBasicAtomicInt ref;
- uint m_data_offset;
+ uint m_index;
QLocale::NumberOptions m_numberOptions;
};
@@ -445,7 +446,7 @@ inline QLocalePrivate *QSharedDataPointer<QLocalePrivate>::clone()
{
// cannot use QLocalePrivate's copy constructor
// since it is deleted in C++11
- return QLocalePrivate::create(d->m_data, d->m_data_offset, d->m_numberOptions);
+ return QLocalePrivate::create(d->m_data, d->m_index, d->m_numberOptions);
}
inline char QLocaleData::numericToCLocale(QStringView in) const