X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/464b15e17d983e96152a126708cc60b36eb9914a..defeae282fad5fa8887d05d2f27cd8a4668491a5:/src/mac/carbon/listbox.cpp

diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp
index a837c5f17d..6697768649 100644
--- a/src/mac/carbon/listbox.cpp
+++ b/src/mac/carbon/listbox.cpp
@@ -58,7 +58,8 @@ bool wxListBox::Create(
 
 wxMacListControl* wxListBox::GetPeer() const
 {
-    return dynamic_cast<wxMacListControl*>(m_peer);
+    wxMacDataBrowserListControl *lb = wxDynamicCast(m_peer,wxMacDataBrowserListControl);
+    return lb ? wx_static_cast(wxMacListControl*,lb) : 0 ;
 }
 
 bool wxListBox::Create(
@@ -463,7 +464,7 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner ,
     DataBrowserItemNotification message,
     DataBrowserItemDataRef itemData ) const
 {
-    wxMacDataBrowserListControl *lb = dynamic_cast<wxMacDataBrowserListControl*>(owner);
+    wxMacDataBrowserListControl *lb = wxDynamicCast(owner,wxMacDataBrowserListControl);
 
     // we want to depend on as little as possible to make sure tear-down of controls is safe
 
@@ -522,6 +523,8 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner ,
     }
 }
 
+IMPLEMENT_DYNAMIC_CLASS( wxMacDataBrowserListControl , wxMacDataItemBrowserControl )
+
 wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style)
     : wxMacDataItemBrowserControl( peer, pos, size, style )
 {