mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-16 08:10:25 +02:00
Protect against not having an initial file type selected
This commit is contained in:
parent
09c8a739f7
commit
141c42bbdb
@ -337,6 +337,11 @@ void FileDialog::ShowWindowModal()
|
||||
|
||||
void FileDialog::DoOnFilterSelected(int index)
|
||||
{
|
||||
if (index == wxNOT_FOUND)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NSArray* types = GetTypesFromExtension(m_filterExtensions[index],m_currentExtensions);
|
||||
NSSavePanel* panel = (NSSavePanel*) GetWXWindow();
|
||||
[panel setAllowedFileTypes:types];
|
||||
@ -551,13 +556,15 @@ int FileDialog::ShowModal()
|
||||
|
||||
m_useFileTypeFilter = m_filterExtensions.GetCount() > 0;
|
||||
|
||||
#if defined(we_always_want_the_types)
|
||||
if( HasFlag(wxFD_OPEN) )
|
||||
{
|
||||
if ( !(wxSystemOptions::HasOption( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES ) && (wxSystemOptions::GetOptionInt( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES ) == 1)) )
|
||||
m_useFileTypeFilter = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_firstFileTypeFilter = -1;
|
||||
m_firstFileTypeFilter = wxNOT_FOUND;
|
||||
|
||||
if ( m_useFileTypeFilter
|
||||
&& m_filterIndex >= 0 && m_filterIndex < m_filterExtensions.GetCount() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user