From 934ce4646422491370b3dce91f02ccc753819474 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Apr 2014 22:39:49 +0000 Subject: [PATCH] Don't call AdjustSpaceLimit() explicitly in wxMSW wxTextCtrl any more. There is no need to do it as this is done by DoWriteText() and AdjustSpaceLimit() doesn't work correctly if called from outside of it now. Because of this, also make it private to prevent other accidental calls to it. Closes #15980. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/textctrl.h | 16 +++++++--------- src/msw/textctrl.cpp | 17 ----------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 14265e7983..f5d08060b8 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -184,8 +184,6 @@ protected: // common part of all ctors void Init(); - virtual bool DoLoadFile(const wxString& file, int fileType); - // creates the control of appropriate class (plain or rich edit) with the // styles corresponding to m_windowStyle // @@ -203,13 +201,6 @@ protected: // the limit is due to a previous call to SetMaxLength() and not built in) bool HasSpaceLimit(unsigned int *len) const; - // call this to increase the size limit (will do nothing if the current - // limit is big enough) - // - // returns true if we increased the limit to allow entering more text, - // false if we hit the limit set by SetMaxLength() and so didn't change it - bool AdjustSpaceLimit(); - #if wxUSE_RICHEDIT && (!wxUSE_UNICODE || wxUSE_UNICODE_MSLU) // replace the selection or the entire control contents with the given text // in the specified encoding @@ -274,6 +265,13 @@ private: void OnKeyDown(wxKeyEvent& event); + // call this to increase the size limit (will do nothing if the current + // limit is big enough) + // + // returns true if we increased the limit to allow entering more text, + // false if we hit the limit set by SetMaxLength() and so didn't change it + bool AdjustSpaceLimit(); + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextCtrl) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 8e2a25a633..207b825c40 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1379,23 +1379,6 @@ void wxTextCtrl::DoSetSelection(long from, long to, int flags) } } -// ---------------------------------------------------------------------------- -// Working with files -// ---------------------------------------------------------------------------- - -bool wxTextCtrl::DoLoadFile(const wxString& file, int fileType) -{ - if ( wxTextCtrlBase::DoLoadFile(file, fileType) ) - { - // update the size limit if needed - AdjustSpaceLimit(); - - return true; - } - - return false; -} - // ---------------------------------------------------------------------------- // dirty status // ----------------------------------------------------------------------------