Use wxDynamicCast() instead of IsKindOf() checks.
wxDynamicCast() is less verbose (due to the absence of "CLASSINFO") and more compatible with the standard dynamic_cast<>, so prefer to use it when possible. See #14356. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -114,21 +114,21 @@ bool wxTextValidator::Copy(const wxTextValidator& val)
|
||||
wxTextEntry *wxTextValidator::GetTextEntry()
|
||||
{
|
||||
#if wxUSE_TEXTCTRL
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)))
|
||||
if (wxDynamicCast(m_validatorWindow, wxTextCtrl))
|
||||
{
|
||||
return (wxTextCtrl*)m_validatorWindow;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)))
|
||||
if (wxDynamicCast(m_validatorWindow, wxComboBox))
|
||||
{
|
||||
return (wxComboBox*)m_validatorWindow;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_COMBOCTRL
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboCtrl)))
|
||||
if (wxDynamicCast(m_validatorWindow, wxComboCtrl))
|
||||
{
|
||||
return (wxComboCtrl*)m_validatorWindow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user