From f7aeba1cddca81ceeeee94bb85179416d395a85b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Apr 2007 22:13:30 +0000 Subject: [PATCH] choose the first extension by default, if several are specified, in the save file dialog (patch 1675781) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/filedlg.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index e3a810a505..c845e7ac0a 100644 --- a/src/mac/carbon/filedlg.cpp +++ b/src/mac/carbon/filedlg.cpp @@ -101,7 +101,11 @@ static pascal void NavEventProc( if ( data->saveMode ) { int i = menu->menuType ; - wxString extension = data->extensions[i].AfterLast('.') ; + + // isolate the first extension string + wxString firstExtension = data->extensions[i].BeforeFirst('|').BeforeFirst(';'); + + wxString extension = firstExtension.AfterLast('.') ; extension.MakeLower() ; wxString sfilename ; @@ -277,8 +281,8 @@ pascal Boolean CrossPlatformFilterCallback( NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ; if ( !theInfo->isFolder ) { - AECoerceDesc (theItem, typeFSRef, theItem); - + AECoerceDesc (theItem, typeFSRef, theItem); + FSRef fsref ; if ( AEGetDescData (theItem, &fsref, sizeof (FSRef)) == noErr ) { -- 2.45.2