Avoid unnecessary wxDynamicCast in wxOSX code
There is no need to check if the control is a wxComboBox if it turns out to already be a wxTextCtrl. No real changes, just a micro-optimization and simplification.
This commit is contained in:
@@ -2440,14 +2440,12 @@ void wxWidgetCocoaImpl::controlTextDidChange()
|
|||||||
if ( wxpeer )
|
if ( wxpeer )
|
||||||
{
|
{
|
||||||
// since native rtti doesn't have to be enabled and wx' rtti is not aware of the mixin wxTextEntry, workaround is needed
|
// since native rtti doesn't have to be enabled and wx' rtti is not aware of the mixin wxTextEntry, workaround is needed
|
||||||
wxTextCtrl *tc = wxDynamicCast( wxpeer , wxTextCtrl );
|
if ( wxTextCtrl *tc = wxDynamicCast( wxpeer , wxTextCtrl ) )
|
||||||
wxComboBox *cb = wxDynamicCast( wxpeer , wxComboBox );
|
|
||||||
if ( tc )
|
|
||||||
{
|
{
|
||||||
tc->MarkDirty();
|
tc->MarkDirty();
|
||||||
tc->SendTextUpdatedEventIfAllowed();
|
tc->SendTextUpdatedEventIfAllowed();
|
||||||
}
|
}
|
||||||
else if ( cb )
|
else if ( wxComboBox *cb = wxDynamicCast( wxpeer , wxComboBox ) )
|
||||||
cb->SendTextUpdatedEventIfAllowed();
|
cb->SendTextUpdatedEventIfAllowed();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user