X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/817270659e986de1b243586d8eb6ad3a76c87480..1a1f3e4b53fd5d1515b16905edf4250dfb2fc676:/src/common/stringimpl.cpp diff --git a/src/common/stringimpl.cpp b/src/common/stringimpl.cpp index 0f1380e708..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,9 +753,8 @@ bool wxStringImpl::ConcatSelf(size_t nSrcLen, return true; } -#if !wxUSE_UNICODE_UTF8 // get the pointer to writable buffer of (at least) nLen bytes -wxChar *wxStringImpl::DoGetWriteBuf(size_t nLen) +wxStringCharType *wxStringImpl::DoGetWriteBuf(size_t nLen) { if ( !AllocBeforeWrite(nLen) ) { // allocation failure handled by caller @@ -770,7 +770,7 @@ wxChar *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