From: Vadim Zeitlin Date: Sun, 4 Nov 2012 23:55:00 +0000 (+0000) Subject: Don't move the insertion point if text didn't change in wxTextEntry. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8effba4f5a412bbfe1949ddec6808e10eb25881f Don't move the insertion point if text didn't change in wxTextEntry. This avoids accidentally resetting the selection if SetValue() is called again with the same value. Closes #13728. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/textentrycmn.cpp b/src/common/textentrycmn.cpp index 3e5c6117e0..2ca2077467 100644 --- a/src/common/textentrycmn.cpp +++ b/src/common/textentrycmn.cpp @@ -230,6 +230,8 @@ void wxTextEntryBase::DoSetValue(const wxString& value, int flags) SelectAll(); WriteText(value); + + SetInsertionPoint(0); } else // Same value, no need to do anything. { @@ -238,8 +240,6 @@ void wxTextEntryBase::DoSetValue(const wxString& value, int flags) if ( flags & SetValue_SendEvent ) SendTextUpdatedEvent(GetEditableWindow()); } - - SetInsertionPoint(0); } void wxTextEntryBase::Replace(long from, long to, const wxString& value)