]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textentrycmn.cpp
Fix deprecating warning introduced in r72446.
[wxWidgets.git] / src / common / textentrycmn.cpp
index 5b08496492d14eba7423de13e6a78193c0e93cb9..971f5626688ed50faab56148b1f5a62469327d04 100644 (file)
@@ -224,10 +224,20 @@ void wxTextEntryBase::AppendText(const wxString& text)
 
 void wxTextEntryBase::DoSetValue(const wxString& value, int flags)
 {
 
 void wxTextEntryBase::DoSetValue(const wxString& value, int flags)
 {
-    EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
+    if ( value != GetValue() )
+    {
+        EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
 
 
-    SelectAll();
-    WriteText(value);
+        SelectAll();
+        WriteText(value);
+    }
+    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());
+    }
 
     SetInsertionPoint(0);
 }
 
     SetInsertionPoint(0);
 }