From: Vadim Zeitlin Date: Sat, 16 Mar 2002 13:04:01 +0000 (+0000) Subject: applied patch 528960 (a few minor bug fixes) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9cb0033cb22efd891e56a8d6b710ce1364b02ea5?ds=sidebyside applied patch 528960 (a few minor bug fixes) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 0015cce6e0..1127ffe740 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -341,7 +341,8 @@ bool wxDocument::OnOpenDocument(const wxString& file) return FALSE; } #if wxUSE_STD_IOSTREAM - if (!LoadObject(store)) + LoadObject(store); + if ( !store && !store.eof() ) #else int res = LoadObject(store).LastError(); if ((res != wxSTREAM_NOERROR) && @@ -960,7 +961,7 @@ void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event) void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event) { wxDocument *doc = GetCurrentDocument(); - event.Enable( (doc != (wxDocument*) NULL) ); + event.Enable( doc && doc->IsModified() ); } void wxDocManager::OnUpdateFileSaveAs(wxUpdateUIEvent& event) @@ -1191,8 +1192,9 @@ bool wxDocManager::FlushDoc(wxDocument *WXUNUSED(doc)) wxDocument *wxDocManager::GetCurrentDocument() const { - if (m_currentView) - return m_currentView->GetDocument(); + wxView *view = GetCurrentView(); + if (view) + return view->GetDocument(); else return (wxDocument *) NULL; }