X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d4d8bbfad1a07877877c69230e12306609d19eb..bcd3d8d9e26e41615d26d457ba0e2b84b80a0356:/src/mac/carbon/filedlg.cpp?ds=sidebyside diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index b0884be347..144cdee796 100644 --- a/src/mac/carbon/filedlg.cpp +++ b/src/mac/carbon/filedlg.cpp @@ -20,7 +20,7 @@ #include "wx/filedlg.h" #include "wx/intl.h" -#if !defined(__UNIX__) +#ifndef __DARWIN__ #include "PLStringFuncs.h" #endif @@ -30,13 +30,11 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog) // begin wxmac -#if defined(__UNIX__) - #include -#else +#ifndef __DARWIN__ #include #endif -#ifndef __UNIX__ +#ifndef __DARWIN__ #include "morefile.h" #include "moreextr.h" #include "fullpath.h" @@ -416,13 +414,12 @@ static Boolean CheckFile( ConstStr255Param name , OSType type , OpenUserDataRecP { Str255 filename ; PLstrcpy( filename , name ) ; - + p2cstr( filename ) ; + wxString file(filename) ; + file.MakeUpper() ; + if ( data->numfilters > 0 ) { - for( int j = 1 ; j <= filename[0] ; j++ ) - { - filename[j] = toupper( filename[j] ) ; - } //for ( int i = 0 ; i < data->numfilters ; ++i ) int i = data->currentfilter ; if ( data->extensions[i].Right(2) == ".*" ) @@ -436,7 +433,7 @@ static Boolean CheckFile( ConstStr255Param name , OSType type , OpenUserDataRecP if ( extension.GetChar(0) == '*' ) extension = extension.Mid(1) ; - if ( filename[0] >= extension.Len() && extension == (char*) filename + 1 + filename[0] - extension.Len() ) + if ( file.Len() >= extension.Len() && extension == file.Right(extension.Len() ) ) return true ; } return false ; @@ -547,7 +544,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, } -Boolean CrossPlatformFilterCallback ( +pascal Boolean CrossPlatformFilterCallback ( AEDesc *theItem, void *info, void *callBackUD, @@ -752,7 +749,7 @@ int wxFileDialog::ShowModal() } } - mNavFilterUPP = NewNavObjectFilterProc( CrossPlatformFilterCallback ) ; + mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ; if ( m_dialogStyle & wxMULTIPLE ) mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ; else