]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Call Expand on an item's parent chain in EnsureVisible
[wxWidgets.git] / include / wx / list.h
index aca713b04c0f0e9f3c8bfa04b9f011f4ab7ff388..7bfeb79f63bd312f13dabf76f08ec50560beecd6 100644 (file)
@@ -275,7 +275,7 @@ inline const void *wxListCastElementToVoidPtr(const wxString& str)
             push_front( e );                                                  \
             return compatibility_iterator( this, begin() );                   \
         }                                                                     \
-        compatibility_iterator Insert( compatibility_iterator & i, elT e )    \
+        compatibility_iterator Insert(const compatibility_iterator & i, elT e)\
         {                                                                     \
             return compatibility_iterator( this, insert( i.m_iter, e ) );     \
         }                                                                     \
@@ -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<wxNodeBase*>(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);            \