]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxString::Replace() to work directly on m_impl -- matters for UTF-8 build
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 19 Apr 2008 11:18:28 +0000 (11:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 19 Apr 2008 11:18:28 +0000 (11:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/string.cpp

index e68c7f03c0de6d5be491592661e754f45c317c86..c3bc9331cbe9ae8ab64e6dce94104d3eb27de2cd 100644 (file)
@@ -1239,17 +1239,17 @@ size_t wxString::Replace(const wxString& strOld,
 
     size_t uiCount = 0;   // count of replacements made
 
-    size_t uiOldLen = strOld.length();
-    size_t uiNewLen = strNew.length();
+    const size_t uiOldLen = strOld.m_impl.length();
+    const size_t uiNewLen = strNew.m_impl.length();
 
-    for ( size_t dwPos = 0; dwPos < length(); )
+    for ( size_t dwPos = 0; dwPos < m_impl.length(); )
     {
-        dwPos = find(strOld, dwPos);
+        dwPos = m_impl.find(strOld.m_impl, dwPos);
         if ( dwPos == npos )
             break;
 
         // replace this occurance of the old string with the new one
-        replace(dwPos, uiOldLen, strNew, uiNewLen);
+        m_impl.replace(dwPos, uiOldLen, strNew.m_impl);
 
         // move up pos past the string that was replaced
         dwPos += uiNewLen;