X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9d3434a3bc2411f1239b9c9b373afc6b88cefc1..41b78190adf985fa6e91a34aba76b1693a8ffc72:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 4d90bd0d72..e92293f142 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -5,8 +5,8 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -568,14 +568,16 @@ void wxTextCtrl::SetValue(const wxString& value) if ( (value.length() > 0x400) || (value != GetValue()) ) { DoWriteText(value, FALSE /* not selection only */); + } - // mark the control as being not dirty - we changed its text, not the - // user - DiscardEdits(); + // we should reset the modified flag even if the value didn't really change - // for compatibility, don't move the cursor when doing SetValue() - SetInsertionPoint(0); - } + // 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)