X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4eb438cf7c42d5ceaa60b55048b5d0dc36c3986b..180db9083613b9b6eca8451ee19553c6581f5505:/src/common/string.cpp?ds=sidebyside diff --git a/src/common/string.cpp b/src/common/string.cpp index c7ce4c3d1c..680cc70c2b 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -1632,7 +1632,7 @@ void wxString::resize(size_t nSize, wxChar ch) } else if ( nSize > len ) { - *this += wxString(ch, len - nSize); + *this += wxString(ch, nSize - len); } //else: we have exactly the specified length, nothing to do } @@ -2156,6 +2156,16 @@ void wxArrayString::Insert(const wxString& str, size_t nIndex) m_nCount++; } +// expand the array +void wxArrayString::SetCount(size_t count) +{ + Alloc(count); + + wxString s; + while ( m_nCount < count ) + m_pItems[m_nCount++] = (wxChar *)s.c_str(); +} + // removes item from array (by index) void wxArrayString::Remove(size_t nIndex) {