From 308e20a74e3ae4802957f7c1fbb99e34d4294057 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Jan 2015 20:45:37 +0000 Subject: [PATCH] Fix wxFileDialog::GetFilterIndex() when opening files in wxOSX. Update m_filterIndex in the "opening" case, just as we already did in the "saving" one (see #13158 and r67550). Closes #16764. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/filedlg.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index 8af141a1f1..a7dea232a2 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -694,6 +694,12 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode) { panel = oPanel; result = wxID_OK; + + if (m_filterChoice) + { + m_filterIndex = m_filterChoice->GetSelection(); + } + NSArray* filenames = [oPanel filenames]; for ( size_t i = 0 ; i < [filenames count] ; ++ i ) {