X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a729bb860cec596f4ce5a59fabeb4404a266e97..0a976765870f164048378a054af1b8904f2ecdb1:/include/wx/dynarray.h diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index cafb60d33a..109a89437c 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -204,7 +204,7 @@ public: \ { int iIndex = Index(Item); \ wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ _WX_ERROR_REMOVE); \ - wxBaseArray::Remove((size_t)iIndex); } \ + wxBaseArray::RemoveAt((size_t)iIndex); } \ \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ } @@ -267,7 +267,7 @@ public: \ { int iIndex = Index(Item); \ wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ _WX_ERROR_REMOVE ); \ - wxBaseArray::Remove((size_t)iIndex); } \ + wxBaseArray::RemoveAt((size_t)iIndex); } \ \ private: \ SCMPFUNC##T m_fnCompare; \ @@ -308,7 +308,7 @@ public: \ \ T* Detach(size_t uiIndex) \ { T* p = (T*)wxBaseArray::Item(uiIndex); \ - wxBaseArray::Remove(uiIndex); return p; } \ + wxBaseArray::RemoveAt(uiIndex); return p; } \ void Remove(size_t uiIndex) { RemoveAt(uiIndex); } \ void RemoveAt(size_t uiIndex); \ \ @@ -448,6 +448,16 @@ WX_DEFINE_EXPORTED_ARRAY(void *, wxArrayPtrVoid); // convinience macros // ----------------------------------------------------------------------------- +// append all element of one array to another one +#define WX_APPEND_ARRAY(array, other) \ + { \ + size_t count = other.Count(); \ + for ( size_t n = 0; n < count; n++ ) \ + { \ + array.Add(other[n]); \ + } \ + } + // delete all array elements // // NB: the class declaration of the array elements must be visible from the