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:
@@ -133,12 +133,13 @@ wxMSW:
|
|||||||
wxWidgets 2.8.9 or later.
|
wxWidgets 2.8.9 or later.
|
||||||
- Fix keyboard support in wxSpinCtrl broken in 2.8.8.
|
- Fix keyboard support in wxSpinCtrl broken in 2.8.8.
|
||||||
- Compile fix for WinCE in window.cpp (no VkKeyScan in Windows CE).
|
- 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).
|
- Support disabling items before adding them to the menu (Christian Walther).
|
||||||
- Allow to call SetFont(wxNullFont) to reset the font to default.
|
- Allow to call SetFont(wxNullFont) to reset the font to default.
|
||||||
- Implement UUID::operator==() and !=() (SQLAware Corporation).
|
- Implement UUID::operator==() and !=() (SQLAware Corporation).
|
||||||
- Fixed long standing (introduced in 2.6.3) bug which resulted in always
|
- Fixed long standing (introduced in 2.6.3) bug which resulted in always
|
||||||
creating a DIB and not DDB in wxBitmap(const wxImage&) ctor.
|
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:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -438,6 +438,13 @@ int wxFileDialog::ShowModal()
|
|||||||
DWORD errCode;
|
DWORD errCode;
|
||||||
bool success = DoShowCommFileDialog(&of, m_windowStyle, &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
|
#ifdef wxTRY_SMALLER_OPENFILENAME
|
||||||
// the system might be too old to support the new version file dialog
|
// the system might be too old to support the new version file dialog
|
||||||
// boxes, try with the old size
|
// boxes, try with the old size
|
||||||
|
Reference in New Issue
Block a user