Make use of SetFilterIndex in wxOSX-Cocoa's file dialog.
Previously the file type would solely be based on the extension of the passed filename. This is still done, but any valid filter index as set by the user will now take precedence. See also #12429. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -163,6 +163,7 @@ wxFileDialog::wxFileDialog(
|
||||
long style, const wxPoint& pos, const wxSize& sz, const wxString& name)
|
||||
: wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos, sz, name)
|
||||
{
|
||||
m_filterIndex = -1;
|
||||
}
|
||||
|
||||
bool wxFileDialog::SupportsExtraControl() const
|
||||
@@ -467,8 +468,6 @@ int wxFileDialog::ShowModal()
|
||||
m_path = wxEmptyString;
|
||||
m_fileNames.Clear();
|
||||
m_paths.Clear();
|
||||
// since we don't support retrieving the matching filter
|
||||
m_filterIndex = -1;
|
||||
|
||||
wxNonOwnedWindow* parentWindow = NULL;
|
||||
int returnCode = -1;
|
||||
@@ -491,7 +490,12 @@ int wxFileDialog::ShowModal()
|
||||
|
||||
m_firstFileTypeFilter = -1;
|
||||
|
||||
if ( m_useFileTypeFilter )
|
||||
if ( m_useFileTypeFilter
|
||||
&& m_filterIndex >= 0 && m_filterIndex < m_filterExtensions.GetCount() )
|
||||
{
|
||||
m_firstFileTypeFilter = m_filterIndex;
|
||||
}
|
||||
else if ( m_useFileTypeFilter )
|
||||
{
|
||||
types = nil;
|
||||
bool useDefault = true;
|
||||
|
Reference in New Issue
Block a user