diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index 44e2d84785c..23944d04dd8 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -182,10 +182,11 @@ QVariant QSystemLocalePrivate::getLocaleInfo(LCTYPE type) int QSystemLocalePrivate::getLocaleInfo_int(LCTYPE type) { - const QString str = getLocaleInfo(type).toString(); - bool ok = false; - const int v = str.toInt(&ok); - return ok ? v : 0; + DWORD value; + int r = GetLocaleInfo(lcid, type | LOCALE_RETURN_NUMBER, + reinterpret_cast(&value), + sizeof(value) / sizeof(wchar_t)); + return r == sizeof(value) / sizeof(wchar_t) ? value : 0; } QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution()