From 20d88ec69276f21bc8627617395c30dd92c03959 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Oct 2010 12:48:36 +0000 Subject: [PATCH] Move wxList::Member() to pseudo-template base list class. Member() should be available in all list classes, not just specially crafted list of wxObjects (wxList). See #3616. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/list.h | 4 +++- src/osx/carbon/nonownedwnd.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/list.h b/include/wx/list.h index 78e86ee694..a2ba1882f4 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -767,6 +767,9 @@ private: virtual nodetype *Find(const wxListKey& key) const \ { return (nodetype *)wxListBase::Find(key); } \ \ + bool Member(const Tbase *object) const \ + { return Find(object) != NULL; } \ + \ int IndexOf(Tbase *object) const \ { return wxListBase::IndexOf(object); } \ \ @@ -1190,7 +1193,6 @@ public: // compatibility methods void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); } - bool Member(wxObject *object) const { return Find(object) != NULL; } #endif // !wxUSE_STL }; diff --git a/src/osx/carbon/nonownedwnd.cpp b/src/osx/carbon/nonownedwnd.cpp index 66c0f90d92..c61fb32f8e 100644 --- a/src/osx/carbon/nonownedwnd.cpp +++ b/src/osx/carbon/nonownedwnd.cpp @@ -722,8 +722,8 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler), if ( currentMouseWindow->HandleWindowEvent(wxevent) ) { - if ((currentMouseWindowParent != NULL) && - (currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL)) + if ( currentMouseWindowParent && + !currentMouseWindowParent->GetChildren().Member(currentMouseWindow) ) currentMouseWindow = NULL; result = noErr;