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:
@@ -341,7 +341,8 @@ bool wxDocument::OnOpenDocument(const wxString& file)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#if wxUSE_STD_IOSTREAM
|
#if wxUSE_STD_IOSTREAM
|
||||||
if (!LoadObject(store))
|
LoadObject(store);
|
||||||
|
if ( !store && !store.eof() )
|
||||||
#else
|
#else
|
||||||
int res = LoadObject(store).LastError();
|
int res = LoadObject(store).LastError();
|
||||||
if ((res != wxSTREAM_NOERROR) &&
|
if ((res != wxSTREAM_NOERROR) &&
|
||||||
@@ -960,7 +961,7 @@ void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
|
|||||||
void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
wxDocument *doc = GetCurrentDocument();
|
wxDocument *doc = GetCurrentDocument();
|
||||||
event.Enable( (doc != (wxDocument*) NULL) );
|
event.Enable( doc && doc->IsModified() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocManager::OnUpdateFileSaveAs(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdateFileSaveAs(wxUpdateUIEvent& event)
|
||||||
@@ -1191,8 +1192,9 @@ bool wxDocManager::FlushDoc(wxDocument *WXUNUSED(doc))
|
|||||||
|
|
||||||
wxDocument *wxDocManager::GetCurrentDocument() const
|
wxDocument *wxDocManager::GetCurrentDocument() const
|
||||||
{
|
{
|
||||||
if (m_currentView)
|
wxView *view = GetCurrentView();
|
||||||
return m_currentView->GetDocument();
|
if (view)
|
||||||
|
return view->GetDocument();
|
||||||
else
|
else
|
||||||
return (wxDocument *) NULL;
|
return (wxDocument *) NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user