X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6519b40fe9f5e4706e02497fe01ff71c65079d6..061fe33fdafda11f2781b4ed25890bd6bb475360:/src/msw/textctrl.cpp?ds=sidebyside diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index a71654a1ec..22aacd1548 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -27,7 +27,6 @@ #if wxUSE_TEXTCTRL && !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) #ifndef WX_PRECOMP - #include "wx/msw/missing.h" #include "wx/textctrl.h" #include "wx/settings.h" #include "wx/brush.h" @@ -52,6 +51,7 @@ #include "wx/msw/private.h" #include "wx/msw/winundef.h" +#include "wx/msw/mslu.h" #include #include @@ -74,6 +74,8 @@ #endif // wxUSE_RICHEDIT +#include "wx/msw/missing.h" + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -662,6 +664,15 @@ void wxTextCtrl::SetWindowStyleFlag(long style) // set/get the controls text // ---------------------------------------------------------------------------- +bool wxTextCtrl::IsEmpty() const +{ + // this is an optimization for multiline controls containing a lot of text + if ( IsMultiLine() && GetNumberOfLines() != 1 ) + return false; + + return wxTextCtrlBase::IsEmpty(); +} + wxString wxTextCtrl::GetValue() const { // range 0..-1 is special for GetRange() and means to retrieve all text @@ -793,7 +804,7 @@ void wxTextCtrl::DoSetValue(const wxString& value, int flags) // edit controls mostly) if ( (value.length() > 0x400) || (value != GetValue()) ) { - DoWriteText(value, flags); + DoWriteText(value, flags /* doesn't include SelectionOnly here */); // mark the control as being not dirty - we changed its text, not the // user @@ -1436,7 +1447,7 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value) // Set selection and remove it DoSetSelection(from, to, false /* don't scroll caret into view */); - DoWriteText(value, SetValue_SelectionOnly); + DoWriteText(value); } void wxTextCtrl::Remove(long from, long to)