Use wxDynamicCast() instead of static_cast<>

This is safer as it really checks if the pointer is of the correct type.
This commit is contained in:
Vadim Zeitlin
2018-06-30 23:09:06 +02:00
parent c369c792a3
commit 0084fb94be

View File

@@ -298,7 +298,7 @@ protected:
int row = [self selectedRow];
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
wxListBox *list = static_cast<wxListBox*> ( impl->GetWXPeer());
wxListBox* const list = wxDynamicCast(impl->GetWXPeer(), wxListBox);
wxCHECK_RET( list != NULL , wxT("Listbox expected"));
// Correct notification events for multiselection list, like in Carbon version