summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringconverter.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2023-10-20 15:46:13 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2023-10-30 21:25:35 +0200
commit36a6522b48dd74305e1a57a520651f34f2d91ee4 (patch)
tree4ee93467de475b9cf70c1d048016c4b4c31a596e /src/corelib/text/qstringconverter.cpp
parentab009f2f03a5d288fb4ee25722337ca5618d8137 (diff)
QLocal8Bit::convertFromUnicode[win]: Drop UsedDefaultChar argument
We don't use the value, and the docs[0] say that we get the best performance if we don't pass the argument. [0] https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte#remarks See table Pick-to: 6.6 6.5 Task-number: QTBUG-118185 Task-number: QTBUG-105105 Change-Id: I3eb5e023a936fe3def5169e3fb492a62708bbf44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/text/qstringconverter.cpp')
-rw-r--r--src/corelib/text/qstringconverter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp
index da02d08c35..a75d2562ef 100644
--- a/src/corelib/text/qstringconverter.cpp
+++ b/src/corelib/text/qstringconverter.cpp
@@ -1396,15 +1396,15 @@ QByteArray QLocal8Bit::convertFromUnicode_sys(QStringView in, quint32 codePage,
return QByteArray();
if (uclen == 0)
return QByteArray("");
- BOOL used_def;
QByteArray mb(4096, 0);
int len;
- while (!(len = WideCharToMultiByte(codePage, 0, ch, uclen, mb.data(), mb.size() - 1, 0,
- &used_def))) {
+ while (!(len = WideCharToMultiByte(codePage, 0, ch, uclen, mb.data(), mb.size() - 1, nullptr,
+ nullptr))) {
int r = GetLastError();
if (r == ERROR_INSUFFICIENT_BUFFER) {
- mb.resize(1+WideCharToMultiByte(codePage, 0, ch, uclen, 0, 0, 0, &used_def));
- // and try again...
+ mb.resize(1
+ + WideCharToMultiByte(codePage, 0, ch, uclen, nullptr, 0, nullptr, nullptr));
+ // and try again...
} else {
// Fail. Probably can't happen in fact (dwFlags is 0).
#ifndef QT_NO_DEBUG