X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b547eb0f86b29467df3ec562ad7a6443c6e34fa5..60913641356f364a5efee5966d3a3b0b48c01001:/include/wx/list.h diff --git a/include/wx/list.h b/include/wx/list.h index aca713b04c..5f9b4d1fa0 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -457,7 +457,7 @@ protected: virtual void DeleteData() { } public: // for wxList::iterator - void** GetDataPtr() const { return &(wx_const_cast(wxNodeBase*, this)->m_data); } + void** GetDataPtr() const { return &(const_cast(this)->m_data); } private: // optional key stuff wxListKeyValue m_key; @@ -1007,7 +1007,10 @@ private: } \ iterator insert(const iterator& it, const_reference v) \ { \ - Insert(it.m_node, (const_base_reference)v); \ + if ( it == end() ) \ + Append((const_base_reference)v); \ + else \ + Insert(it.m_node, (const_base_reference)v); \ iterator itprev(it); \ return itprev--; \ } \ @@ -1017,7 +1020,7 @@ private: Insert(it.m_node, (const_base_reference)v); \ } \ void insert(const iterator& it, \ - const const_iterator& first, const const_iterator& last)\ + const_iterator first, const const_iterator& last) \ { \ for(; first != last; ++first) \ Insert(it.m_node, (const_base_reference)*first); \