X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d59eea2639501cdb31a5d79c69e387ca3817d3da..f604c658271c884b41c3cb5a427dff67355ae3d4:/src/common/fldlgcmn.cpp diff --git a/src/common/fldlgcmn.cpp b/src/common/fldlgcmn.cpp index c9d8e15494..119665674f 100644 --- a/src/common/fldlgcmn.cpp +++ b/src/common/fldlgcmn.cpp @@ -80,59 +80,17 @@ wxFileDialogBase::wxFileDialogBase(wxWindow *parent, } } +#if WXWIN_COMPATIBILITY_2_4 // Parses the filterStr, returning the number of filters. // Returns 0 if none or if there's a problem. // filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg" - int wxFileDialogBase::ParseWildcard(const wxString& filterStr, wxArrayString& descriptions, wxArrayString& filters) { - descriptions.Clear(); - filters.Clear(); - - wxString str(filterStr); - - wxString description, filter; - for ( int pos = 0; pos != wxNOT_FOUND; ) - { - pos = str.Find(wxT('|')); - if ( pos == wxNOT_FOUND ) - { - // if there are no '|'s at all in the string just take the entire - // string as filter - if ( filters.IsEmpty() ) - { - descriptions.Add(filterStr); - filters.Add(filterStr); - } - else - { - wxFAIL_MSG( _T("missing '|' in the wildcard string!") ); - } - - break; - } - - description = str.Left(pos); - str = str.Mid(pos + 1); - pos = str.Find(wxT('|')); - if ( pos == wxNOT_FOUND ) - { - filter = str; - } - else - { - filter = str.Left(pos); - str = str.Mid(pos + 1); - } - - descriptions.Add(description); - filters.Add(filter); - } - - return filters.GetCount(); + return ::wxParseCommonDialogsFilter(filterStr, descriptions, filters); } +#endif // WXWIN_COMPATIBILITY_2_4 wxString wxFileDialogBase::AppendExtension(const wxString &filePath, const wxString &extensionList) @@ -217,7 +175,7 @@ wxString wxFileSelector(const wxChar *title, wxArrayString descriptions, filters; // don't care about errors, handled already by wxFileDialog - (void)wxFileDialogBase::ParseWildcard(filter2, descriptions, filters); + (void)wxParseCommonDialogsFilter(filter2, descriptions, filters); for (size_t n=0; n