X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2c09fb3b8b492e6cdfd003a6d8f441aa255f2045..26364344e58ae9c384965ff25c6920a75c55184e:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 316e042182..4d16458ff8 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -56,14 +56,9 @@ // static class variables definition // --------------------------------------------------------------------------- -#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 -// must define this static for VA or else you get multiply defined symbols -// everywhere -const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100; -#endif // Visual Age - #if !wxUSE_STL - const size_t wxStringBase::npos = wxSTRING_MAXLEN; + //According to STL _must_ be a -1 size_t + const size_t wxStringBase::npos = (size_t) -1; #endif // ---------------------------------------------------------------------------- @@ -1029,7 +1024,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength) size_t nRealSize; wxWCharBuffer theBuffer = conv.cMB2WC(psz, nLen, &nRealSize); - //Copy + //Copy if (nRealSize) assign( theBuffer.data() , nRealSize - 1 ); } @@ -1085,7 +1080,7 @@ wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength) size_t nRealSize; wxCharBuffer theBuffer = conv.cWC2MB(pwz, nLen, &nRealSize); - //Copy + //Copy if (nRealSize) assign( theBuffer.data() , nRealSize - 1 ); } @@ -1634,7 +1629,7 @@ inline int wxSafeIsspace(wxChar ch) { return (ch < 127) && wxIsspace(ch); } wxString& wxString::Trim(bool bFromRight) { // first check if we're going to modify the string at all - if ( !IsEmpty() && + if ( !empty() && ( (bFromRight && wxSafeIsspace(GetChar(Len() - 1))) || (!bFromRight && wxSafeIsspace(GetChar(0u))) @@ -2200,6 +2195,11 @@ wxString* wxArrayString::GetStringArray() const return array; } +void wxArrayString::Remove(size_t nIndex, size_t nRemove) +{ + RemoveAt(nIndex, nRemove); +} + #endif // WXWIN_COMPATIBILITY_2_4 // searches the array for an item (forward or backwards)