using the 'new' bottleneck methods, fixing bugreport from Bengt Nilsson <bengt.nilsson11@spray.se>
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -329,30 +329,23 @@ bool DrawingCommand::Undo(void)
|
||||
IMPLEMENT_DYNAMIC_CLASS(TextEditDocument, wxDocument)
|
||||
|
||||
// Since text windows have their own method for saving to/loading from files,
|
||||
// we override OnSave/OpenDocument instead of Save/LoadObject
|
||||
bool TextEditDocument::OnSaveDocument(const wxString& filename)
|
||||
// we override DoSave/OpenDocument instead of Save/LoadObject
|
||||
bool TextEditDocument::DoSaveDocument(const wxString& filename)
|
||||
{
|
||||
TextEditView *view = (TextEditView *)GetFirstView();
|
||||
|
||||
if (!view->textsw->SaveFile(filename))
|
||||
return false;
|
||||
Modify(false);
|
||||
#ifdef __WXMAC__
|
||||
wxFileName fn(filename) ;
|
||||
fn.MacSetDefaultTypeAndCreator() ;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TextEditDocument::OnOpenDocument(const wxString& filename)
|
||||
bool TextEditDocument::DoOpenDocument(const wxString& filename)
|
||||
{
|
||||
TextEditView *view = (TextEditView *)GetFirstView();
|
||||
if (!view->textsw->LoadFile(filename))
|
||||
return false;
|
||||
|
||||
SetFilename(filename, true);
|
||||
Modify(false);
|
||||
UpdateAllViews();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user