qlocale_win: Rename a misnamed local variable
Although the function is called get{Dat,Tim}eFormat(), the content it's filling the buffer with isn't a format, it's a formatted date or time. So name the variable we transcribe the buffer into text instead of misleadingly calling it format. Change-Id: Ia3a51184963109a50dbc41e205bd8c83d83c04d7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
6f8ef8c64d
commit
f5aeb4f970
@ -399,10 +399,10 @@ QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type)
|
|||||||
DWORD flags = (type == QLocale::LongFormat ? DATE_LONGDATE : DATE_SHORTDATE);
|
DWORD flags = (type == QLocale::LongFormat ? DATE_LONGDATE : DATE_SHORTDATE);
|
||||||
wchar_t buf[255];
|
wchar_t buf[255];
|
||||||
if (getDateFormat(flags, &st, NULL, buf, 255)) {
|
if (getDateFormat(flags, &st, NULL, buf, 255)) {
|
||||||
QString format = QString::fromWCharArray(buf);
|
QString text = QString::fromWCharArray(buf);
|
||||||
if (substitution() == SAlways)
|
if (substitution() == SAlways)
|
||||||
format = substituteDigits(std::move(format));
|
text = substituteDigits(std::move(text));
|
||||||
return format;
|
return text;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
@ -422,10 +422,10 @@ QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type)
|
|||||||
|
|
||||||
wchar_t buf[255];
|
wchar_t buf[255];
|
||||||
if (getTimeFormat(flags, &st, NULL, buf, 255)) {
|
if (getTimeFormat(flags, &st, NULL, buf, 255)) {
|
||||||
QString format = QString::fromWCharArray(buf);
|
QString text = QString::fromWCharArray(buf);
|
||||||
if (substitution() == SAlways)
|
if (substitution() == SAlways)
|
||||||
format = substituteDigits(std::move(format));
|
text = substituteDigits(std::move(text));
|
||||||
return format;
|
return text;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user