]> git.saurik.com Git - wxWidgets.git/commitdiff
Simplify SetValue() with empty string
authorRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 19:40:28 +0000 (19:40 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 19:40:28 +0000 (19:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/textctrl.cpp

index 3dc367da3e27bb72d7043640c8f17056ce1ac9f1..340ab8038f48836d8ef229ddca1dd3eceb2227a0 100644 (file)
@@ -955,6 +955,19 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
         return;
     }
 
+    if (value.IsEmpty())
+    {
+        if ( !(flags & SetValue_SendEvent) )
+            EnableTextChangedEvents(false);
+        
+        gtk_text_buffer_set_text( m_buffer, "", 0 );
+            
+        if ( !(flags & SetValue_SendEvent) )
+            EnableTextChangedEvents(true);
+            
+        return;
+    }
+
     wxFontEncoding enc = m_defaultStyle.HasFont()
                             ? m_defaultStyle.GetFont().GetEncoding()
                             : wxFONTENCODING_SYSTEM;