From: Vadim Zeitlin Date: Tue, 20 Apr 2004 11:35:49 +0000 (+0000) Subject: fixed bug in default filter string construction (you can't Printf() a string in itself) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/40bb1d31d992913e20a1f91ffb8e1288ed94bd26 fixed bug in default filter string construction (you can't Printf() a string in itself) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fldlgcmn.cpp b/src/common/fldlgcmn.cpp index 3f08486a1a..5dfa9e516b 100644 --- a/src/common/fldlgcmn.cpp +++ b/src/common/fldlgcmn.cpp @@ -48,19 +48,16 @@ wxFileDialogBase::wxFileDialogBase(wxWindow *parent, m_message = message; m_dir = defaultDir; m_fileName = defaultFile; - m_wildCard = wildCard; + m_wildCard = wildCard.empty() ? wxFileSelectorDefaultWildcardStr : wildCard; m_dialogStyle = style; m_path = wxT(""); m_filterIndex = 0; - if (m_wildCard.IsEmpty()) - m_wildCard = wxFileSelectorDefaultWildcardStr; - // convert m_wildCard from "*.bar" to "Files (*.bar)|*.bar" if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND ) { - m_wildCard.Printf(_("Files (%s)|%s"), - m_wildCard.c_str(), m_wildCard.c_str()); + m_wildCard = wxString::Format(_("Files (%s)|%s"), + m_wildCard.c_str(), m_wildCard.c_str()); } }