From d4d8988c72e26ea5ef68b87a53691da7c3751a95 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 22 Mar 2006 19:14:28 +0000 Subject: [PATCH] made wxList methods return compatibility_iterator instead of Node * to further reduce differences between wxUSE_STL==0 and 1 cases git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/list.h | 20 ++++++++++---------- src/common/list.cpp | 6 ++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/wx/list.h b/include/wx/list.h index acca225fca..5f0790af7b 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -702,12 +702,12 @@ private: name& operator=(const name& list) \ { Assign(list); return *this; } \ \ - nodetype *GetFirst() const \ + compatibility_iterator GetFirst() const \ { return (nodetype *)wxListBase::GetFirst(); } \ - nodetype *GetLast() const \ + compatibility_iterator GetLast() const \ { return (nodetype *)wxListBase::GetLast(); } \ \ - nodetype *Item(size_t index) const \ + compatibility_iterator Item(size_t index) const \ { return (nodetype *)wxListBase::Item(index); } \ \ T *operator[](size_t index) const \ @@ -716,18 +716,18 @@ private: return node ? (T*)(node->GetData()) : (T*)NULL; \ } \ \ - nodetype *Append(Tbase *object) \ + compatibility_iterator Append(Tbase *object) \ { return (nodetype *)wxListBase::Append(object); } \ - nodetype *Insert(Tbase *object) \ + compatibility_iterator Insert(Tbase *object) \ { return (nodetype *)Insert((nodetype*)NULL, object); } \ - nodetype *Insert(size_t pos, Tbase *object) \ + compatibility_iterator Insert(size_t pos, Tbase *object) \ { return (nodetype *)wxListBase::Insert(pos, object); } \ - nodetype *Insert(nodetype *prev, Tbase *object) \ + compatibility_iterator Insert(nodetype *prev, Tbase *object) \ { return (nodetype *)wxListBase::Insert(prev, object); } \ \ - nodetype *Append(long key, void *object) \ + compatibility_iterator Append(long key, void *object) \ { return (nodetype *)wxListBase::Append(key, object); } \ - nodetype *Append(const wxChar *key, void *object) \ + compatibility_iterator Append(const wxChar *key, void *object) \ { return (nodetype *)wxListBase::Append(key, object); } \ \ nodetype *DetachNode(nodetype *node) \ @@ -739,7 +739,7 @@ private: void Erase(compatibility_iterator it) \ { DeleteNode(it); } \ \ - nodetype *Find(const Tbase *object) const \ + compatibility_iterator Find(const Tbase *object) const \ { return (nodetype *)wxListBase::Find(object); } \ \ virtual nodetype *Find(const wxListKey& key) const \ diff --git a/src/common/list.cpp b/src/common/list.cpp index 25fbff411d..9cd9c1b90d 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -742,12 +742,14 @@ void wxStringList::Sort() wxNode *wxStringList::Add(const wxChar *s) { - return (wxNode *)wxStringListBase::Append(MYcopystring(s)); + return (wxNode *)(wxStringListBase::Node *) + wxStringListBase::Append(MYcopystring(s)); } wxNode *wxStringList::Prepend(const wxChar *s) { - return (wxNode *)wxStringListBase::Insert(MYcopystring(s)); + return (wxNode *)(wxStringListBase::Node *) + wxStringListBase::Insert(MYcopystring(s)); } #endif // wxLIST_COMPATIBILITY -- 2.45.2