Set wxTextAreaBase::m_filename in the methods of this class itself.

m_filename member was declared in wxTextAreaBase but set only in the
overridden wxTextCtrlBase methods. This meant that it wasn't updated correctly
in wxStyledTextCtrl which also derives from wxTextAreaBase and so saving
SaveFile() with empty file name didn't work there even when the control had
been originally loaded from a file.

Move the code updating m_filename to wxTextAreaBase itself to fix this. This
also simplifies the code as it's now not necessary to override
Do{Load,Save}File() in wxTextCtrlBase at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-03-27 11:58:09 +00:00
parent dace99a4ef
commit 90761420ee
2 changed files with 16 additions and 32 deletions

View File

@@ -743,9 +743,6 @@ protected:
int overflow(int i);
#endif // wxHAS_TEXT_WINDOW_STREAM
virtual bool DoLoadFile(const wxString& file, int fileType);
virtual bool DoSaveFile(const wxString& file, int fileType);
// Another wxTextAreaBase override.
virtual bool IsValidPosition(long pos) const
{