handle FNERR_INVALIDFILENAME which happens if an invalid file name is passed to wxFileDialog (#9688) [backport from trunk]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-08-23 17:49:04 +00:00
parent e50f48d518
commit 76ae7f748b
2 changed files with 9 additions and 1 deletions

View File

@@ -133,12 +133,13 @@ wxMSW:
wxWidgets 2.8.9 or later.
- Fix keyboard support in wxSpinCtrl broken in 2.8.8.
- Compile fix for WinCE in window.cpp (no VkKeyScan in Windows CE).
- Fix quoting of arguments passed to wxExecute(char **) (Brian Ravnsgaard Riis).
- Support disabling items before adding them to the menu (Christian Walther).
- Allow to call SetFont(wxNullFont) to reset the font to default.
- Implement UUID::operator==() and !=() (SQLAware Corporation).
- Fixed long standing (introduced in 2.6.3) bug which resulted in always
creating a DIB and not DDB in wxBitmap(const wxImage&) ctor.
- Fix the bug with wxFileDialog not being shown at all if the default file name
was invalid.
wxGTK:

View File

@@ -438,6 +438,13 @@ int wxFileDialog::ShowModal()
DWORD errCode;
bool success = DoShowCommFileDialog(&of, m_windowStyle, &errCode);
if ( !success && errCode == FNERR_INVALIDFILENAME && of.lpstrFile[0] )
{
// this can happen if the default file name is invalid, try without it now
of.lpstrFile[0] = _T('\0');
success = DoShowCommFileDialog(&of, m_windowStyle, &errCode);
}
#ifdef wxTRY_SMALLER_OPENFILENAME
// the system might be too old to support the new version file dialog
// boxes, try with the old size