]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
don't use GetParent() in GetParentForModalDialog() itself as it can be called before...
[wxWidgets.git] / include / wx / list.h
index 4a55c64134475d11e8d8aa1d6ef8d4b683d70626..b8cc07ea8471f4bdf4b403ea2f26b8119f8f7d24 100644 (file)
@@ -468,7 +468,7 @@ private:
 
     wxListBase  *m_list;        // list we belong to
 
-    DECLARE_NO_COPY_CLASS(wxNodeBase)
+    wxDECLARE_NO_COPY_CLASS(wxNodeBase);
 };
 
 // -----------------------------------------------------------------------------
@@ -1019,13 +1019,13 @@ private:
         void insert(const iterator& it, size_type n, const_reference v)     \
         {                                                                   \
             for(size_type i = 0; i < n; ++i)                                \
-                Insert(it.m_node, (const_base_reference)v);                 \
+                insert(it, v);                                              \
         }                                                                   \
         void insert(const iterator& it,                                     \
                     const_iterator first, const const_iterator& last)       \
         {                                                                   \
             for(; first != last; ++first)                                   \
-                Insert(it.m_node, (const_base_reference)*first);            \
+                insert(it, *first);                                         \
         }                                                                   \
         iterator erase(const iterator& it)                                  \
         {                                                                   \
@@ -1034,7 +1034,9 @@ private:
         }                                                                   \
         iterator erase(const iterator& first, const iterator& last)         \
         {                                                                   \
-            iterator next = last; ++next;                                   \
+            iterator next = last;                                           \
+            if ( next != end() )                                            \
+                ++next;                                                     \
             DeleteNodes(first.m_node, last.m_node);                         \
             return next;                                                    \
         }                                                                   \
@@ -1045,10 +1047,11 @@ private:
             { splice(it, l, l.begin(), l.end() ); }                         \
         void splice(const iterator& it, name& l, const iterator& first)     \
         {                                                                   \
-            iterator tmp = first; ++tmp;                                    \
-            if(it == first || it == tmp) return;                            \
-            insert(it, *first);                                             \
-            l.erase(first);                                                 \
+            if ( it != first )                                              \
+            {                                                               \
+                insert(it, *first);                                         \
+                l.erase(first);                                             \
+            }                                                               \
         }                                                                   \
         void remove(const_reference v)                                      \
             { DeleteObject((const_base_reference)v); }                      \