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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user