From da32743f22ecdf32ff25899ea5f7abcce8d126ea Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 24 Mar 2003 19:00:04 +0000 Subject: [PATCH] calling SetValue(GetValue()) didn't reset the modified flag (bug 678391) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/toback24.txt | 8 ++++++++ src/msw/textctrl.cpp | 14 ++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/toback24.txt b/docs/toback24.txt index 4993ba844a..dfcf8f04e4 100644 --- a/docs/toback24.txt +++ b/docs/toback24.txt @@ -466,3 +466,11 @@ Checking in include/wx/msw/spinctrl.h; /pack/cvsroots/wxwindows/wxWindows/include/wx/msw/spinctrl.h,v <-- spinctrl.h new revision: 1.16; previous revision: 1.15 +40. calling SetValue(GetValue()) didn't reset the modified flag + +http://sf.net/tracker/index.php?func=detail&aid=678391&group_id=9863&atid=109863 + +Checking in src/msw/textctrl.cpp; +/pack/cvsroots/wxwindows/wxWindows/src/msw/textctrl.cpp,v <-- textctrl.cpp +new revision: 1.164; previous revision: 1.163 + diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 53f74e07fd..e92293f142 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -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) -- 2.45.2