]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/arrimpl.cpp
experimental --inplace flag implementation
[wxWidgets.git] / include / wx / arrimpl.cpp
index 8296608a019b2155b8c41ae55b633a13a0a0ec84..46f94e5dabae6b8075eb9625bd94458d34ab4aa4 100644 (file)
@@ -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);                      \