From 120249f602e466e8a47bbb345043cf379552aa3d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 10 Oct 2003 08:21:08 +0000 Subject: [PATCH] Don't set insertion point if the text is the same in SetValue git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 3b0c9572ea..f7b8d15231 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -637,6 +637,9 @@ void wxTextCtrl::SetValue(const wxString& value) if ( (value.length() > 0x400) || (value != GetValue()) ) { DoWriteText(value, FALSE /* not selection only */); + + // for compatibility, don't move the cursor when doing SetValue() + SetInsertionPoint(0); } else // same text { @@ -649,9 +652,6 @@ void wxTextCtrl::SetValue(const wxString& value) // mark the control as being not dirty - we changed its text, not the // user DiscardEdits(); - - // for compatibility, don't move the cursor when doing SetValue() - SetInsertionPoint(0); } #if wxUSE_RICHEDIT && (!wxUSE_UNICODE || wxUSE_UNICODE_MSLU) -- 2.45.2