wxListBase *m_list; // list we belong to
- DECLARE_NO_COPY_CLASS(wxNodeBase)
+ wxDECLARE_NO_COPY_CLASS(wxNodeBase);
};
// -----------------------------------------------------------------------------
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) \
{ \
} \
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; \
} \
{ 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); } \
(list).clear(); \
}
+// append all element of one list to another one
+#define WX_APPEND_LIST(list, other) \
+ { \
+ wxList::compatibility_iterator node = other->GetFirst(); \
+ while ( node ) \
+ { \
+ (list)->push_back(node->GetData()); \
+ node = node->GetNext(); \
+ } \
+ }
+
#endif // _WX_LISTH__