X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e58eaff7617f0936b1b8c448dd381f8e2d7ccf78..357d2b88cb15fa0ad97b1676fdbc88c2abc85451:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index e308d867c0..3498256d94 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -582,10 +582,10 @@ bool wxDocument::DoSaveDocument(const wxString& file) { #if wxUSE_STD_IOSTREAM wxSTD ofstream store(file.mb_str(), wxSTD ios::binary); - if (store.fail() || store.bad()) + if ( !store ) #else wxFileOutputStream store(file); - if (store.GetLastError() != wxSTREAM_NO_ERROR) + if ( store.GetLastError() != wxSTREAM_NO_ERROR ) #endif { wxLogError(_("File \"%s\" could not be opened for writing."), file); @@ -605,7 +605,7 @@ bool wxDocument::DoOpenDocument(const wxString& file) { #if wxUSE_STD_IOSTREAM wxSTD ifstream store(file.mb_str(), wxSTD ios::binary); - if ( store.fail() || store.bad() ) + if ( !store ) #else wxFileInputStream store(file); if (store.GetLastError() != wxSTREAM_NO_ERROR) @@ -617,7 +617,7 @@ bool wxDocument::DoOpenDocument(const wxString& file) #if wxUSE_STD_IOSTREAM LoadObject(store); - if ( store.fail() || store.bad() ) + if ( !store ) #else int res = LoadObject(store).GetLastError(); if ( res != wxSTREAM_NO_ERROR && res != wxSTREAM_EOF ) @@ -972,7 +972,7 @@ void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event)) void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event)) { - CreateDocument( wxEmptyString, wxDOC_NEW ); + CreateNewDocument(); } void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event))