X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6603ac2ffa78093bbe9a4938b481abff1987c77..6962f34ea5bf7a931bb9b636f46ad1316473a724:/src/msw/filedlg.cpp diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 249f674d4e..c50dfe1f0d 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -398,24 +398,6 @@ int wxFileDialog::ShowModal() : (GetOpenFileName(&of) != 0); } } - -#if wxUSE_UNICODE_MSLU && defined(OFN_EXPLORER) - // VS: these's a bug in unicows.dll - when multiple files are - // selected, of.nFileOffset doesn't point to the first - // filename but rather to the last component of directory - // name. Let's try to fix it: - if ( (m_dialogStyle & wxMULTIPLE) && - (fileNameBuffer[of.nFileOffset-1] != wxT('\0')) && - wxGetOsVersion() == wxWIN95 /*using unicows.dll*/) - { - if ( wxDirExists(fileNameBuffer) ) - { - // 1st component is dir => multiple files selected - of.nFileOffset = wxStrlen(fileNameBuffer)+1; - } - } -#endif // wxUSE_UNICODE_MSLU - #endif // __WIN32__ if ( success ) @@ -471,6 +453,17 @@ int wxFileDialog::ShowModal() { // User has typed a filename without an extension: + // A filename can end in a "." here ("abc."), this means it + // does not have an extension. Because later on a "." with + // the default extension is appended we remove the "." if + // filename ends with one (We don't want files called + // "abc..ext") + int idx = wxStrlen(fileNameBuffer) - 1; + if ( fileNameBuffer[idx] == wxT('.') ) + { + fileNameBuffer[idx] = wxT('\0'); + } + int maxFilter = (int)(of.nFilterIndex*2L-1L); extension = filterBuffer;