]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/arrimpl.cpp
experimental --inplace flag implementation
[wxWidgets.git] / include / wx / arrimpl.cpp
index 844eb4b75143dbc38eb91dda7fc4dd6458d8a716..46f94e5dabae6b8075eb9625bd94458d34ab4aa4 100644 (file)
@@ -52,7 +52,7 @@ name& name::operator=(const name& src)                                        \
   return *this;                                                               \
 }                                                                             \
                                                                               \
-name::name(const name& src)                                                   \
+name::name(const name& src) : wxArrayPtrVoid()                                \
 {                                                                             \
   DoCopy(src);                                                                \
 }                                                                             \
@@ -75,6 +75,8 @@ void name::RemoveAt(size_t uiIndex, size_t nRemove)                           \
                                                                               \
 void name::Add(const T& item, size_t nInsert)                                 \
 {                                                                             \
+  if (nInsert == 0)                                                           \
+    return;                                                                   \
   T* pItem = new T(item);                                                     \
   size_t nOldSize = GetCount();                                               \
   if ( pItem != NULL )                                                        \
@@ -85,6 +87,8 @@ void name::Add(const T& item, size_t nInsert)                                 \
                                                                               \
 void name::Insert(const T& item, size_t uiIndex, size_t nInsert)              \
 {                                                                             \
+  if (nInsert == 0)                                                           \
+    return;                                                                   \
   T* pItem = new T(item);                                                     \
   if ( pItem != NULL )                                                        \
     wxBaseArrayPtrVoid::Insert(pItem, uiIndex, nInsert);                      \