Don't call ClearAll() before LoadFile() in the stc sample.
There is no need to clear the control contents before loading a file into it because LoadFile() is supposed to do this on its own (although currently it doesn't, which will be fixed soon). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -533,18 +533,6 @@ bool Edit::LoadFile (const wxString &filename) {
|
||||
|
||||
// load file in edit and clear undo
|
||||
if (!filename.empty()) m_filename = filename;
|
||||
// wxFile file (m_filename);
|
||||
// if (!file.IsOpened()) return false;
|
||||
ClearAll ();
|
||||
// long lng = file.Length ();
|
||||
// if (lng > 0) {
|
||||
// wxString buf;
|
||||
// wxChar *buff = buf.GetWriteBuf (lng);
|
||||
// file.Read (buff, lng);
|
||||
// buf.UngetWriteBuf ();
|
||||
// InsertText (0, buf);
|
||||
// }
|
||||
// file.Close();
|
||||
|
||||
wxStyledTextCtrl::LoadFile(m_filename);
|
||||
|
||||
|
Reference in New Issue
Block a user