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)
|
IMPLEMENT_DYNAMIC_CLASS(TextEditDocument, wxDocument)
|
||||||
|
|
||||||
// Since text windows have their own method for saving to/loading from files,
|
// Since text windows have their own method for saving to/loading from files,
|
||||||
// we override OnSave/OpenDocument instead of Save/LoadObject
|
// we override DoSave/OpenDocument instead of Save/LoadObject
|
||||||
bool TextEditDocument::OnSaveDocument(const wxString& filename)
|
bool TextEditDocument::DoSaveDocument(const wxString& filename)
|
||||||
{
|
{
|
||||||
TextEditView *view = (TextEditView *)GetFirstView();
|
TextEditView *view = (TextEditView *)GetFirstView();
|
||||||
|
|
||||||
if (!view->textsw->SaveFile(filename))
|
if (!view->textsw->SaveFile(filename))
|
||||||
return false;
|
return false;
|
||||||
Modify(false);
|
|
||||||
#ifdef __WXMAC__
|
|
||||||
wxFileName fn(filename) ;
|
|
||||||
fn.MacSetDefaultTypeAndCreator() ;
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEditDocument::OnOpenDocument(const wxString& filename)
|
bool TextEditDocument::DoOpenDocument(const wxString& filename)
|
||||||
{
|
{
|
||||||
TextEditView *view = (TextEditView *)GetFirstView();
|
TextEditView *view = (TextEditView *)GetFirstView();
|
||||||
if (!view->textsw->LoadFile(filename))
|
if (!view->textsw->LoadFile(filename))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SetFilename(filename, true);
|
|
||||||
Modify(false);
|
|
||||||
UpdateAllViews();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -93,8 +93,8 @@ public:
|
|||||||
wxSTD ostream& SaveObject(wxSTD ostream& stream);
|
wxSTD ostream& SaveObject(wxSTD ostream& stream);
|
||||||
wxSTD istream& LoadObject(wxSTD istream& stream);
|
wxSTD istream& LoadObject(wxSTD istream& stream);
|
||||||
*/
|
*/
|
||||||
virtual bool OnSaveDocument(const wxString& filename);
|
virtual bool DoSaveDocument(const wxString& filename);
|
||||||
virtual bool OnOpenDocument(const wxString& filename);
|
virtual bool DoOpenDocument(const wxString& filename);
|
||||||
virtual bool IsModified(void) const;
|
virtual bool IsModified(void) const;
|
||||||
virtual void Modify(bool mod);
|
virtual void Modify(bool mod);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user