]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fix for non-UTF-8 build
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Aug 2008 19:39:23 +0000 (19:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Aug 2008 19:39:23 +0000 (19:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/string.h

index 62b362b1ed9849a22b875bbddd526bb22bbd22ff..50c4cc929614ae02c6700e7f4d960b0a72aaf222 100644 (file)
@@ -2899,8 +2899,13 @@ public:
   // swap two strings
   void swap(wxString& str)
   {
   // swap two strings
   void swap(wxString& str)
   {
-      wxSTRING_INVALIDATE_CACHE();
-      str.wxSTRING_INVALIDATE_CACHE();
+#if wxUSE_STRING_POS_CACHE
+      // we modify not only this string but also the other one directly so we
+      // need to invalidate cache for both of them (we could also try to
+      // exchange their cache entries but it seems unlikely to be worth it)
+      InvalidateCache();
+      str.InvalidateCache();
+#endif // wxUSE_STRING_POS_CACHE
 
       m_impl.swap(str.m_impl);
   }
 
       m_impl.swap(str.m_impl);
   }