]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed single-line text control breakage (sorry). Now only
authorJulian Smart <julian@anthemion.co.uk>
Wed, 10 Apr 2002 13:00:04 +0000 (13:00 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 10 Apr 2002 13:00:04 +0000 (13:00 +0000)
skips the refresh when the new and old values are the same.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/textctrl.cpp

index 50329f67fe389cd0b9ccd63d9041fd3ffc9133b6..7bf22a1c67da3e389f736c88a20205457839ca16 100644 (file)
@@ -275,12 +275,8 @@ void wxTextCtrl::SetValue(const wxString& value)
 {
     m_modified = FALSE;
 
-    if ((GetWindowStyle() & wxTE_MULTILINE) == 0)
-    {
-        if (value == GetValue())
-            return;
-    }
-    
+    wxString oldValue = GetValue();
+
     m_cursorX = 0;
     m_cursorY = 0;
     ClearSelection();
@@ -330,6 +326,13 @@ void wxTextCtrl::SetValue(const wxString& value)
             }
         }
     }
+
+    // Don't need to refresh if the value hasn't changed
+    if ((GetWindowStyle() & wxTE_MULTILINE) == 0)
+    {
+        if (value == oldValue)
+            return;
+    }
     
     MyAdjustScrollbars();