From f5aeb4f970844ef6fbdc97d99fc7c57786d75dae Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 6 Aug 2021 12:26:23 +0200 Subject: [PATCH] qlocale_win: Rename a misnamed local variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/corelib/text/qlocale_win.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index 0c83dcffb9..a73656440f 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -399,10 +399,10 @@ QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type) DWORD flags = (type == QLocale::LongFormat ? DATE_LONGDATE : DATE_SHORTDATE); wchar_t buf[255]; if (getDateFormat(flags, &st, NULL, buf, 255)) { - QString format = QString::fromWCharArray(buf); + QString text = QString::fromWCharArray(buf); if (substitution() == SAlways) - format = substituteDigits(std::move(format)); - return format; + text = substituteDigits(std::move(text)); + return text; } return QString(); } @@ -422,10 +422,10 @@ QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type) wchar_t buf[255]; if (getTimeFormat(flags, &st, NULL, buf, 255)) { - QString format = QString::fromWCharArray(buf); + QString text = QString::fromWCharArray(buf); if (substitution() == SAlways) - format = substituteDigits(std::move(format)); - return format; + text = substituteDigits(std::move(text)); + return text; } return QString(); }