]> git.saurik.com Git - wxWidgets.git/commitdiff
choose the first extension by default, if several are specified, in the save file...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Apr 2007 22:13:30 +0000 (22:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Apr 2007 22:13:30 +0000 (22:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/filedlg.cpp

index e3a810a5055b89581b285bb559eaffecd3d6b701..c845e7ac0a73f11851c2b9562dcdbe4fa0130681 100644 (file)
@@ -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 )
             {