X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64c12a6d559c20e495d1ad79b7a6fb547d9cc7b1..1229a1e7bf7a28e44d764f1c23d97d317df07bfd:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index ce47e57dd5..bd6fa67c3d 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -571,7 +571,7 @@ bool wxDocument::DoSaveDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - wxSTD ofstream store(file.mb_str()); + wxSTD ofstream store(file.mb_str(), wxSTD ios::binary); if (store.fail() || store.bad()) #else wxFileOutputStream store(file); @@ -597,7 +597,7 @@ bool wxDocument::DoSaveDocument(const wxString& file) bool wxDocument::DoOpenDocument(const wxString& file) { #if wxUSE_STD_IOSTREAM - wxSTD ifstream store(file.mb_str()); + wxSTD ifstream store(file.mb_str(), wxSTD ios::binary); if (!store.fail() && !store.bad()) #else wxFileInputStream store(file); @@ -2165,6 +2165,8 @@ void wxFileHistory::AddFileToHistory(const wxString& file) pathInMenu = m_fileHistory[i]; } + // we need to quote '&' characters which are used for mnemonics + pathInMenu.Replace(_T("&"), _T("&&")); wxString buf; buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str()); wxList::compatibility_iterator node = m_fileMenus.GetFirst();