X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34138703c3997ce676a1e713d9ff9eb020640da7..720dcba6483841de8fda9ef0091bbb7a19ca2fd4:/src/stubs/filedlg.cpp?ds=inline diff --git a/src/stubs/filedlg.cpp b/src/stubs/filedlg.cpp index 2aeffdf926..8832598af4 100644 --- a/src/stubs/filedlg.cpp +++ b/src/stubs/filedlg.cpp @@ -23,7 +23,7 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog) #endif -char *wxFileSelector(const char *title, +wxString wxFileSelector(const char *title, const char *defaultDir, const char *defaultFileName, const char *defaultExtension, const char *filter, int flags, wxWindow *parent, int x, int y) @@ -53,14 +53,13 @@ char *wxFileSelector(const char *title, if ( fileDialog.ShowModal() == wxID_OK ) { - strcpy(wxBuffer, (const char *)fileDialog.GetPath()); - return wxBuffer; + return fileDialog.GetPath(); } else - return NULL; + return wxEmptyString; } -char *wxFileSelectorEx(const char *title, +wxString wxFileSelectorEx(const char *title, const char *defaultDir, const char *defaultFileName, int* defaultFilterIndex, @@ -77,11 +76,10 @@ char *wxFileSelectorEx(const char *title, if ( fileDialog.ShowModal() == wxID_OK ) { *defaultFilterIndex = fileDialog.GetFilterIndex(); - strcpy(wxBuffer, (const char *)fileDialog.GetPath()); - return wxBuffer; + return fileDialog.GetPath(); } else - return NULL; + return wxEmptyString; } wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, @@ -105,8 +103,7 @@ int wxFileDialog::ShowModal() } // Generic file load/save dialog -static char * -wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent) +static wxString wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent) { char *ext = (char *)extension; @@ -126,16 +123,14 @@ wxDefaultFileSelector(bool load, const char *what, const char *extension, const } // Generic file load dialog -char * -wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) +wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) { return wxDefaultFileSelector(TRUE, what, extension, default_name, parent); } // Generic file save dialog -char * -wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) +wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) { return wxDefaultFileSelector(FALSE, what, extension, default_name, parent); }