using the 'new' bottleneck methods, fixing bugreport from Bengt Nilsson <bengt.nilsson11@spray.se>
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -330,29 +330,22 @@ 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 OnSave/OpenDocument instead of Save/LoadObject
|
||||||
bool TextEditDocument::OnSaveDocument(const wxString& filename)
|
bool TextEditDocument::DoSaveDocument(const wxString& filename)
|
||||||
{
|
{
|
||||||
TextEditView* view = GetFirstView();
|
TextEditView* view = GetFirstView();
|
||||||
|
|
||||||
if (!view->m_textsw->SaveFile(filename))
|
if (!view->m_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 = GetFirstView();
|
TextEditView* view = GetFirstView();
|
||||||
if (!view->m_textsw->LoadFile(filename))
|
if (!view->m_textsw->LoadFile(filename))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SetFilename(filename, true);
|
|
||||||
Modify(false);
|
|
||||||
UpdateAllViews();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -97,8 +97,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
TextEditView* GetFirstView() const;
|
TextEditView* GetFirstView() const;
|
||||||
|
|
||||||
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