mirror of https://github.com/qt/qtbase.git
Merge cf818947fe
into c7b3cb5f2a
This commit is contained in:
commit
c86f0311a9
|
@ -1752,7 +1752,7 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow
|
||||||
int totalStringLength = 0;
|
int totalStringLength = 0;
|
||||||
const QList<FilterSpec> specs =
|
const QList<FilterSpec> specs =
|
||||||
filterSpecs(m_options->nameFilters(), m_options->options() & QFileDialogOptions::HideNameFilterDetails, &totalStringLength);
|
filterSpecs(m_options->nameFilters(), m_options->options() & QFileDialogOptions::HideNameFilterDetails, &totalStringLength);
|
||||||
const int size = specs.size();
|
if (const int size = specs.size()) {
|
||||||
auto *ptr = new wchar_t[totalStringLength + 2 * size + 1];
|
auto *ptr = new wchar_t[totalStringLength + 2 * size + 1];
|
||||||
ofn->lpstrFilter = ptr;
|
ofn->lpstrFilter = ptr;
|
||||||
for (const FilterSpec &spec : specs) {
|
for (const FilterSpec &spec : specs) {
|
||||||
|
@ -1762,6 +1762,7 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow
|
||||||
*ptr++ = 0;
|
*ptr++ = 0;
|
||||||
}
|
}
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
|
}
|
||||||
const int nameFilterIndex = indexOfNameFilter(m_options->nameFilters(), m_data.selectedNameFilter());
|
const int nameFilterIndex = indexOfNameFilter(m_options->nameFilters(), m_data.selectedNameFilter());
|
||||||
if (nameFilterIndex >= 0)
|
if (nameFilterIndex >= 0)
|
||||||
ofn->nFilterIndex = nameFilterIndex + 1; // 1..n based.
|
ofn->nFilterIndex = nameFilterIndex + 1; // 1..n based.
|
||||||
|
|
Loading…
Reference in New Issue