Simplify SetValue() with empty string

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-05-23 19:40:28 +00:00
parent 9a8d75f1ed
commit d1263a3992

View 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;