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
This commit is contained in:
Vadim Zeitlin
2002-03-16 13:04:01 +00:00
parent 2d4b5a5e99
commit 9cb0033cb2

View File

@@ -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;
}