use proper type for index in QLocale::monthName(), QLocale::standaloneMonthName(), QString QLocale::dayName() and QLocale::standaloneDayName()

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2020-01-04 03:58:35 +00:00
parent 0cb4ecde7d
commit f4a1d4ae2a

View file

@ -1702,7 +1702,7 @@ QString QLocale::monthName(int month, FormatType type) const
}
#endif
const quint16 idx = month - 1;
const qint16 idx = month - 1;
switch (type) {
case QLocale::LongFormat:
return getLocaleListData(d()->m_long_month_names, idx);
@ -1740,7 +1740,7 @@ QString QLocale::standaloneMonthName(int month, FormatType type) const
}
#endif
const quint16 idx = month - 1;
const qint16 idx = month - 1;
switch (type) {
case QLocale::LongFormat:
return getLocaleListData(d()->m_standalone_long_month_names, idx);
@ -1776,7 +1776,7 @@ QString QLocale::dayName(int day, FormatType type) const
}
#endif
const quint16 idx = day - 1;
const qint16 idx = day - 1;
switch (type) {
case QLocale::LongFormat:
return getLocaleListData(d()->m_long_day_names, idx);
@ -1815,7 +1815,7 @@ QString QLocale::standaloneDayName(int day, FormatType type) const
}
#endif
quint16 idx = day - 1;
const qint16 idx = day - 1;
switch (type) {
case QLocale::LongFormat:
return getLocaleListData(d()->m_standalone_long_day_names, idx);