From 137b730319c304f99a7b0dcd441c0fe332aa11b2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Jul 2003 19:56:46 +0000 Subject: [PATCH] compatibiltiy functions should be inline, we don't want to take space hit for using them nor speed hit for the user code! git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/list.h | 21 +++++++++++++++++++++ src/common/list.cpp | 18 ------------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/include/wx/list.h b/include/wx/list.h index c51e085977..0621496821 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -990,6 +990,27 @@ private: #ifdef wxLIST_COMPATIBILITY +// inline compatibility functions + +// ----------------------------------------------------------------------------- +// wxNodeBase deprecated methods +// ----------------------------------------------------------------------------- + +inline wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); } +inline wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); } +inline wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); } + +// ----------------------------------------------------------------------------- +// wxListBase deprecated methods +// ----------------------------------------------------------------------------- + +inline int wxListBase::Number() const { return (int)GetCount(); } +inline wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); } +inline wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); } +inline wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); } +inline wxListBase::operator wxList&() const { return *(wxList*)this; } + + // define this to make a lot of noise about use of the old wxList classes. //#define wxWARN_COMPAT_LIST_USE diff --git a/src/common/list.cpp b/src/common/list.cpp index 8c6d14fdba..9532eac9ca 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -574,24 +574,6 @@ void wxListBase::DeleteNodes(wxNodeBase* first, wxNodeBase* last) #ifdef wxLIST_COMPATIBILITY -// ----------------------------------------------------------------------------- -// wxNodeBase deprecated methods -// ----------------------------------------------------------------------------- - -wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); } -wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); } -wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); } - -// ----------------------------------------------------------------------------- -// wxListBase deprecated methods -// ----------------------------------------------------------------------------- - -int wxListBase::Number() const { return GetCount(); } -wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); } -wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); } -wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); } -wxListBase::operator wxList&() const { return *(wxList*)this; } - // ----------------------------------------------------------------------------- // wxList (a.k.a. wxObjectList) // -----------------------------------------------------------------------------