X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3622daa901777a33969d8bc04e2d62dee14d164..d1427b705318677afe28b1291867f6930c8823a7:/src/common/dynarray.cpp diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index fbf3972fe3..40ada21b23 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -24,6 +24,7 @@ #endif #include "wx/dynarray.h" +#include #include #include // for memmove @@ -100,7 +101,8 @@ void wxBaseArray::Grow() else { // add 50% but not too much - uint uiIncrement = m_uiSize >> 1; + uint uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE + ? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1; if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT ) uiIncrement = ARRAY_MAXSIZE_INCREMENT; m_uiSize += uiIncrement; @@ -226,7 +228,7 @@ void wxBaseArray::Add(long lItem, CMPFUNC fnCompare) // add item at the given position void wxBaseArray::Insert(long lItem, uint uiIndex) { - wxCHECK_RET( uiIndex <= m_uiCount, "bad index in wxArray::Insert" ); + wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Insert") ); Grow(); @@ -239,7 +241,7 @@ void wxBaseArray::Insert(long lItem, uint uiIndex) // removes item from array (by index) void wxBaseArray::Remove(uint uiIndex) { - wxCHECK_RET( uiIndex <= m_uiCount, "bad index in wxArray::Remove" ); + wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Remove") ); memmove(&m_pItems[uiIndex], &m_pItems[uiIndex + 1], (m_uiCount - uiIndex - 1)*sizeof(long)); @@ -252,7 +254,7 @@ void wxBaseArray::Remove(long lItem) int iIndex = Index(lItem); wxCHECK_RET( iIndex != NOT_FOUND, - "removing inexistent item in wxArray::Remove" ); + _("removing inexistent item in wxArray::Remove") ); Remove((uint)iIndex); }