]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
'i' is already used in this scope so make it clearer.
[wxWidgets.git] / src / common / docview.cpp
index ce47e57dd5f012ed56eaff1aaac40d27083091ce..bd6fa67c3d1b481e372f02b0fd379b66c17d471c 100644 (file)
@@ -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();