X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eaf6da074684bb26937905e8a0369009e2c03da2..a4ea083bbdf710d3234dcbd2eafb5d0e078f8348:/src/common/arrstr.cpp diff --git a/src/common/arrstr.cpp b/src/common/arrstr.cpp index bb22e7e88c..f66fcdd4ee 100644 --- a/src/common/arrstr.cpp +++ b/src/common/arrstr.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 29/01/98 -// RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -33,7 +32,7 @@ wxArrayString::wxArrayString(size_t sz, const char** a) { -#if !wxUSE_STL +#if !wxUSE_STD_CONTAINERS Init(false); #endif for (size_t i=0; i < sz; i++) @@ -42,7 +41,7 @@ wxArrayString::wxArrayString(size_t sz, const char** a) wxArrayString::wxArrayString(size_t sz, const wchar_t** a) { -#if !wxUSE_STL +#if !wxUSE_STD_CONTAINERS Init(false); #endif for (size_t i=0; i < sz; i++) @@ -51,14 +50,14 @@ wxArrayString::wxArrayString(size_t sz, const wchar_t** a) wxArrayString::wxArrayString(size_t sz, const wxString* a) { -#if !wxUSE_STL +#if !wxUSE_STD_CONTAINERS Init(false); #endif for (size_t i=0; i < sz; i++) Add(a[i]); } -#if !wxUSE_STL +#if !wxUSE_STD_CONTAINERS // size increment = min(50% of current size, ARRAY_MAXSIZE_INCREMENT) #define ARRAY_MAXSIZE_INCREMENT 4096 @@ -206,6 +205,7 @@ void wxArrayString::Shrink() pNew[j] = m_pItems[j]; delete [] m_pItems; m_pItems = pNew; + m_nSize = m_nCount; } } @@ -344,6 +344,14 @@ wxArrayString::insert(iterator it, const_iterator first, const_iterator last) } } +void wxArrayString::resize(size_type n, value_type v) +{ + if ( n < m_nCount ) + m_nCount = n; + else if ( n > m_nCount ) + Add(v, n - m_nCount); +} + // expand the array void wxArrayString::SetCount(size_t count) { @@ -378,13 +386,6 @@ void wxArrayString::Remove(const wxString& sz) RemoveAt(iIndex); } -void wxArrayString::assign(const_iterator first, const_iterator last) -{ - reserve(last - first); - for(; first != last; ++first) - push_back(*first); -} - // ---------------------------------------------------------------------------- // sorting // ---------------------------------------------------------------------------- @@ -460,7 +461,7 @@ bool wxArrayString::operator==(const wxArrayString& a) const return true; } -#endif // !wxUSE_STL +#endif // !wxUSE_STD_CONTAINERS // =========================================================================== // wxJoin and wxSplit