]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't cache incorrect length in wxString::DoUngetWriteBuf().
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Mar 2012 15:13:16 +0000 (15:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Mar 2012 15:13:16 +0000 (15:13 +0000)
The length here is the size of the buffer in bytes and is not necessarily the
string length in code points (notably not for non-ASCII strings in UTF-8
build).

Closes #14130.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/string.h

index 03c21a7acf5cf6c3f873ef01bfbfe449e31d97a5..ee63cf915c794fe11f5ce97b149b102f3db4d09c 100644 (file)
@@ -3485,7 +3485,7 @@ private:
 
   void DoUngetWriteBuf(size_t nLen)
   {
-      wxSTRING_SET_CACHED_LENGTH(nLen);
+      wxSTRING_INVALIDATE_CACHE();
 
       m_impl.DoUngetWriteBuf(nLen);
   }