Fixed signed/unsigned warning (GetCount() returns size_t, not int); Slight cosmetic cleanup.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2003-11-27 12:09:08 +00:00
parent 41f1cec7ae
commit 685a634c8d
2 changed files with 208 additions and 202 deletions

View File

@@ -135,7 +135,7 @@ NavEventProc(
sfilename = wxMacMakeStringFromPascal( filename ) ; sfilename = wxMacMakeStringFromPascal( filename ) ;
#endif #endif
int pos = sfilename.Find('.',TRUE) ; int pos = sfilename.Find('.', true) ;
if ( pos != wxNOT_FOUND ) if ( pos != wxNOT_FOUND )
{ {
sfilename = sfilename.Left(pos+1)+extension ; sfilename = sfilename.Left(pos+1)+extension ;
@@ -175,7 +175,7 @@ void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
{ {
myData->menuitems = NULL ; myData->menuitems = NULL ;
myData->currentfilter = 0 ; myData->currentfilter = 0 ;
myData->saveMode = FALSE ; myData->saveMode = false ;
if ( filter && filter[0] ) if ( filter && filter[0] )
{ {
@@ -394,7 +394,6 @@ int wxFileDialog::ShowModal()
// The extension is important // The extension is important
dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension; dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension;
err = ::NavCreatePutFileDialog(&dialogCreateOptions, err = ::NavCreatePutFileDialog(&dialogCreateOptions,
'TEXT', 'TEXT',
'TEXT', 'TEXT',
@@ -405,8 +404,9 @@ int wxFileDialog::ShowModal()
else else
{ {
MakeUserDataRec(&myData , m_wildCard); MakeUserDataRec(&myData , m_wildCard);
int numfilters = myData.extensions.GetCount(); size_t numfilters = myData.extensions.GetCount();
if (numfilters > 0){ if (numfilters > 0)
{
CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault , CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault ,
numfilters , &kCFTypeArrayCallBacks ) ; numfilters , &kCFTypeArrayCallBacks ) ;
dialogCreateOptions.popupExtension = popup ; dialogCreateOptions.popupExtension = popup ;
@@ -416,6 +416,7 @@ int wxFileDialog::ShowModal()
CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] ) ) ; CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] ) ) ;
} }
} }
navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback); navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback);
err = ::NavCreateGetFileDialog(&dialogCreateOptions, err = ::NavCreateGetFileDialog(&dialogCreateOptions,
NULL, // NavTypeListHandle NULL, // NavTypeListHandle
@@ -571,9 +572,10 @@ int wxFileDialog::ShowModal()
err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation ); err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation );
if ( mDefaultLocation.dataHandle ) { if ( mDefaultLocation.dataHandle )
{
if (mSelectDefault) { if (mSelectDefault)
{
mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation; mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
} else { } else {
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation; mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
@@ -663,8 +665,8 @@ int wxFileDialog::ShowModal()
return wxID_CANCEL ; return wxID_CANCEL ;
} }
if (mNavReply.validRecord) { if (mNavReply.validRecord)
{
FSSpec outFileSpec ; FSSpec outFileSpec ;
AEDesc specDesc ; AEDesc specDesc ;
AEKeyword keyWord ; AEKeyword keyWord ;
@@ -674,7 +676,8 @@ int wxFileDialog::ShowModal()
for ( long i = 1 ; i <= count ; ++i ) for ( long i = 1 ; i <= count ; ++i )
{ {
OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc); OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc);
if ( err != noErr ) { if ( err != noErr )
{
m_path = wxT("") ; m_path = wxT("") ;
return wxID_CANCEL ; return wxID_CANCEL ;
} }

View File

@@ -135,7 +135,7 @@ NavEventProc(
sfilename = wxMacMakeStringFromPascal( filename ) ; sfilename = wxMacMakeStringFromPascal( filename ) ;
#endif #endif
int pos = sfilename.Find('.',TRUE) ; int pos = sfilename.Find('.', true) ;
if ( pos != wxNOT_FOUND ) if ( pos != wxNOT_FOUND )
{ {
sfilename = sfilename.Left(pos+1)+extension ; sfilename = sfilename.Left(pos+1)+extension ;
@@ -175,7 +175,7 @@ void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
{ {
myData->menuitems = NULL ; myData->menuitems = NULL ;
myData->currentfilter = 0 ; myData->currentfilter = 0 ;
myData->saveMode = FALSE ; myData->saveMode = false ;
if ( filter && filter[0] ) if ( filter && filter[0] )
{ {
@@ -394,7 +394,6 @@ int wxFileDialog::ShowModal()
// The extension is important // The extension is important
dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension; dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension;
err = ::NavCreatePutFileDialog(&dialogCreateOptions, err = ::NavCreatePutFileDialog(&dialogCreateOptions,
'TEXT', 'TEXT',
'TEXT', 'TEXT',
@@ -405,8 +404,9 @@ int wxFileDialog::ShowModal()
else else
{ {
MakeUserDataRec(&myData , m_wildCard); MakeUserDataRec(&myData , m_wildCard);
int numfilters = myData.extensions.GetCount(); size_t numfilters = myData.extensions.GetCount();
if (numfilters > 0){ if (numfilters > 0)
{
CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault , CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault ,
numfilters , &kCFTypeArrayCallBacks ) ; numfilters , &kCFTypeArrayCallBacks ) ;
dialogCreateOptions.popupExtension = popup ; dialogCreateOptions.popupExtension = popup ;
@@ -416,6 +416,7 @@ int wxFileDialog::ShowModal()
CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] ) ) ; CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] ) ) ;
} }
} }
navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback); navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback);
err = ::NavCreateGetFileDialog(&dialogCreateOptions, err = ::NavCreateGetFileDialog(&dialogCreateOptions,
NULL, // NavTypeListHandle NULL, // NavTypeListHandle
@@ -571,9 +572,10 @@ int wxFileDialog::ShowModal()
err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation ); err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation );
if ( mDefaultLocation.dataHandle ) { if ( mDefaultLocation.dataHandle )
{
if (mSelectDefault) { if (mSelectDefault)
{
mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation; mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
} else { } else {
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation; mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
@@ -663,8 +665,8 @@ int wxFileDialog::ShowModal()
return wxID_CANCEL ; return wxID_CANCEL ;
} }
if (mNavReply.validRecord) { if (mNavReply.validRecord)
{
FSSpec outFileSpec ; FSSpec outFileSpec ;
AEDesc specDesc ; AEDesc specDesc ;
AEKeyword keyWord ; AEKeyword keyWord ;
@@ -674,7 +676,8 @@ int wxFileDialog::ShowModal()
for ( long i = 1 ; i <= count ; ++i ) for ( long i = 1 ; i <= count ; ++i )
{ {
OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc); OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc);
if ( err != noErr ) { if ( err != noErr )
{
m_path = wxT("") ; m_path = wxT("") ;
return wxID_CANCEL ; return wxID_CANCEL ;
} }