Don't append just a dot in wxGTK wxFileDialog if no default extension.
We always appended the default extension (for the currently selected pattern) to the file name but this was the wrong thing to do if there was no extension at all as this resulted in appending just a dot to the filename. So only do it if there is an extension to append. Closes #15285. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
88343ddae9
commit
42ed9de292
@ -268,11 +268,11 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
|
||||
if ( !wildCard.empty() && !defaultFileName.empty() &&
|
||||
!wxFileName(defaultFileName).HasExt() )
|
||||
{
|
||||
// append the default extension to the initial file name: GTK won't do
|
||||
// it for us by default (unlike e.g. MSW)
|
||||
const wxString defaultExt = m_fc.GetCurrentWildCard().AfterFirst('.');
|
||||
if ( defaultExt.find_first_of("?*") == wxString::npos )
|
||||
defaultFileNameWithExt += "." + defaultExt;
|
||||
// append the default extension, if any, to the initial file name: GTK
|
||||
// won't do it for us by default (unlike e.g. MSW)
|
||||
const wxFileName fnWC(m_fc.GetCurrentWildCard());
|
||||
if ( fnWC.HasExt() )
|
||||
defaultFileNameWithExt << "." << fnWC.GetExt();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user