X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85047589a993f5c5529e1dae284be8af84cd68ef..87f0b1323b7ac77f02133b836c8dfee63b0fd387:/src/common/textentrycmn.cpp diff --git a/src/common/textentrycmn.cpp b/src/common/textentrycmn.cpp index 5b08496492..2ca2077467 100644 --- a/src/common/textentrycmn.cpp +++ b/src/common/textentrycmn.cpp @@ -224,12 +224,22 @@ void wxTextEntryBase::AppendText(const wxString& text) void wxTextEntryBase::DoSetValue(const wxString& value, int flags) { - EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent)); + if ( value != DoGetValue() ) + { + EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent)); - SelectAll(); - WriteText(value); + SelectAll(); + WriteText(value); - SetInsertionPoint(0); + SetInsertionPoint(0); + } + else // Same value, no need to do anything. + { + // Except that we still need to generate the event for consistency with + // the normal case when the text does change. + if ( flags & SetValue_SendEvent ) + SendTextUpdatedEvent(GetEditableWindow()); + } } void wxTextEntryBase::Replace(long from, long to, const wxString& value)