X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c87a0bc8cb73b38f9bf7e8d67620f504c0ea4aea..1c0338c5615c351371f704b326634f58d0bf7da9:/src/common/stringimpl.cpp diff --git a/src/common/stringimpl.cpp b/src/common/stringimpl.cpp index ecf9ea5b1b..af847b54e1 100644 --- a/src/common/stringimpl.cpp +++ b/src/common/stringimpl.cpp @@ -30,6 +30,7 @@ #ifndef WX_PRECOMP #include "wx/stringimpl.h" + #include "wx/wxcrt.h" #endif #include @@ -162,9 +163,9 @@ void wxStringImpl::InitWith(const wxStringCharType *psz, // if the length is not given, assume the string to be NUL terminated if ( nLength == npos ) { - wxASSERT_MSG( nPos <= Strsize(psz), _T("index out of bounds") ); + wxASSERT_MSG( nPos <= wxStrlen(psz), _T("index out of bounds") ); - nLength = Strsize(psz + nPos); + nLength = wxStrlen(psz + nPos); } STATISTICS_ADD(InitialLength, nLength); @@ -426,7 +427,7 @@ wxStringImpl& wxStringImpl::insert(size_t nPos, { wxASSERT( nPos <= length() ); - if ( n == npos ) n = Strsize(sz); + if ( n == npos ) n = wxStrlen(sz); if ( n == 0 ) return *this; if ( !Alloc(length() + n) || !CopyBeforeWrite() ) { @@ -666,7 +667,7 @@ wxStringImpl& wxStringImpl::operator=(wxStringCharType ch) // assigns C string wxStringImpl& wxStringImpl::operator=(const wxStringCharType *psz) { - if ( !AssignCopy(Strsize(psz), psz) ) { + if ( !AssignCopy(wxStrlen(psz), psz) ) { wxFAIL_MSG( _T("out of memory in wxStringImpl::operator=(const wxStringCharType *)") ); } return *this; @@ -752,7 +753,6 @@ bool wxStringImpl::ConcatSelf(size_t nSrcLen, return true; } -#if !wxUSE_UNICODE_UTF8 // get the pointer to writable buffer of (at least) nLen bytes wxStringCharType *wxStringImpl::DoGetWriteBuf(size_t nLen) { @@ -770,7 +770,7 @@ wxStringCharType *wxStringImpl::DoGetWriteBuf(size_t nLen) // put string back in a reasonable state after GetWriteBuf void wxStringImpl::DoUngetWriteBuf() { - DoUngetWriteBuf(Strsize(m_pchData)); + DoUngetWriteBuf(wxStrlen(m_pchData)); } void wxStringImpl::DoUngetWriteBuf(size_t nLen) @@ -784,6 +784,5 @@ void wxStringImpl::DoUngetWriteBuf(size_t nLen) pData->nDataLength = nLen; pData->Validate(true); } -#endif // !wxUSE_UNICODE_UTF8 #endif // !wxUSE_STL_BASED_WXSTRING