/////////////////////////////////////////////////////////////////////////////
-// Name: filedlg.cpp
+// Name: src/mac/carbon/filedlg.cpp
// Purpose: wxFileDialog
// Author: Stefan Csomor
// Modified by:
#include "wx/wxprec.h"
+#include "wx/filedlg.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/intl.h"
+#endif
+
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/dialog.h"
-#include "wx/filedlg.h"
-#include "wx/intl.h"
#include "wx/tokenzr.h"
#include "wx/filename.h"
// an explanatory text, in that case the first part is name and extension at the same time
wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ;
- if ( current.IsEmpty() )
+ if ( current.empty() )
myData->extensions.Add( myData->name[filterIndex] ) ;
else
myData->extensions.Add( current.MakeUpper() ) ;
wxString extension = myData->extensions[i];
// Remove leading '*'
- if (extension.GetChar(0) == '*')
+ if (extension.length() && (extension.GetChar(0) == '*'))
extension = extension.Mid( 1 );
// Remove leading '.'
- if (extension.GetChar(0) == '.')
+ if (extension.length() && (extension.GetChar(0) == '.'))
extension = extension.Mid( 1 );
-
+
if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator ))
myData->filtermactypes.Add( (OSType)fileType );
else
{
// let the user select bundles/programs in dialogs
dialogCreateOptions.optionFlags |= kNavSupportPackages;
-
+
navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback);
err = ::NavCreateGetFileDialog(
&dialogCreateOptions,
thePath = wxMacFSRefToPath( &theFSRef, navReply.saveFileName );
else
thePath = wxMacFSRefToPath( &theFSRef );
-
+
if (!thePath)
{
::NavDisposeReply(&navReply);
return (err == noErr) ? wxID_OK : wxID_CANCEL;
}
-