X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d4d8bbfad1a07877877c69230e12306609d19eb..594f0f5bf1355fb8d58f403d3ebacc1c1767c429:/src/mac/carbon/filedlg.cpp?ds=sidebyside diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index b0884be347..1d6fd58d44 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, @@ -563,7 +560,11 @@ Boolean CrossPlatformFilterCallback ( if (theItem->descriptorType == typeFSS && !theInfo->isFolder) { FSSpec spec; - memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ; +#if TARGET_CARBON + ::AEGetDescData(theItem, &spec, sizeof(FSSpec) ) ; +#else + memcpy( &spec , (*theItem->dataHandle) , sizeof(FSSpec) ) ; +#endif display = CheckFile( spec.name , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; } } @@ -752,7 +753,7 @@ int wxFileDialog::ShowModal() } } - mNavFilterUPP = NewNavObjectFilterProc( CrossPlatformFilterCallback ) ; + mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ; if ( m_dialogStyle & wxMULTIPLE ) mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ; else