X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ea1246ba6783b30d5bc0877720f976b4dc9e5b9..d7e918b594dccaada636fb2dd99081bc89e99db6:/include/wx/list.h?ds=sidebyside diff --git a/include/wx/list.h b/include/wx/list.h index 33ae0bf486..a2907d0693 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -181,16 +181,18 @@ private: static BaseListType EmptyList; \ \ bool m_destroy; \ + \ public: \ decl compatibility_iterator \ { \ private: \ - /* Workaround for broken VC6 nested class name resolution */ \ - typedef std::list::iterator iterator; \ - friend class liT; \ - private: \ + /* Workaround for broken VC6 nested class name resolution */ \ + typedef std::list::iterator iterator; \ + friend class liT; \ + \ iterator m_iter; \ liT * m_list; \ + \ public: \ compatibility_iterator() \ : m_iter(EmptyList.end()), m_list( NULL ) {} \ @@ -262,9 +264,9 @@ private: std::advance( i, idx ); \ return compatibility_iterator( this, i ); \ } \ - compatibility_iterator operator[](size_t idx) const \ + elT operator[](size_t idx) const \ { \ - return Item(idx); \ + return Item(idx).GetData(); \ } \ \ compatibility_iterator GetFirst() const \ @@ -338,6 +340,9 @@ private: void Sort( wxSortCompareFunction compfunc ) \ { sort( WX_LIST_SORTFUNCTION( elT, compfunc ) ); } \ ~liT() { Clear(); } \ + \ + /* It needs access to our EmptyList */ \ + friend decl compatibility_iterator; \ } #define WX_DECLARE_LIST(elementtype, listname) \ @@ -364,11 +369,6 @@ private: #else // if !wxUSE_STL -// due to circular header dependencies this function has to be declared here -// (normally it's found in utils.h which includes itself list.h...) -#if WXWIN_COMPATIBILITY_2_4 -extern WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s); -#endif // undef it to get rid of old, deprecated functions #define wxLIST_COMPATIBILITY