Fix #9917: File save dialog does not honor file extension on GTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -335,7 +335,21 @@ void wxFileDialog::OnSize(wxSizeEvent&)
|
||||
|
||||
wxString wxFileDialog::GetPath() const
|
||||
{
|
||||
return m_fc.GetPath();
|
||||
wxFileName fn = m_fc.GetPath();
|
||||
|
||||
if (HasFdFlag(wxFD_SAVE))
|
||||
{
|
||||
// add extension
|
||||
if (!fn.HasExt())
|
||||
{
|
||||
wxFileName wildcard( "/dummy", m_fc.GetCurrentWildCard() );
|
||||
wxString ext = wildcard.GetExt();
|
||||
if (!ext.empty() && (ext.Find('?') == wxNOT_FOUND) && (ext.Find('*') == wxNOT_FOUND))
|
||||
fn.SetExt( ext );
|
||||
}
|
||||
}
|
||||
|
||||
return fn.GetFullPath();
|
||||
}
|
||||
|
||||
void wxFileDialog::GetFilenames(wxArrayString& files) const
|
||||
|
Reference in New Issue
Block a user