X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6bd4f2812dca25f2c693ba27e5c117deee71fb3e..47e105413fda3097f4ff5a3d9a224b8123aa5501:/src/common/unichar.cpp diff --git a/src/common/unichar.cpp b/src/common/unichar.cpp index 7a8df7600d..163d388744 100644 --- a/src/common/unichar.cpp +++ b/src/common/unichar.cpp @@ -100,7 +100,7 @@ wxUniCharRef& wxUniCharRef::operator=(const wxUniChar& c) for ( size_t i = 0; i < lenNew; ++i, ++pos ) *pos = utf[i]; } - else + else // length of character encoding in UTF-8 changed { // the worse case is when the new value has either longer or shorter // code -- in that case, we have to use wxStringImpl::replace() and @@ -148,6 +148,10 @@ wxUniCharRef& wxUniCharRef::operator=(const wxUniChar& c) // update the string: strimpl.replace(m_pos, m_pos + lenOld, utf, lenNew); +#if wxUSE_STRING_POS_CACHE + m_str.InvalidateCache(); +#endif // wxUSE_STRING_POS_CACHE + // finally, set the iterators to valid values again (note that this // updates m_pos as well): size_t i;