fix wxString::Replace when new strings are longer than old string
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1551,8 +1551,8 @@ size_t wxString::Replace(const wxChar *szOld,
|
|||||||
//replace this occurance of the old string with the new one
|
//replace this occurance of the old string with the new one
|
||||||
replace(dwPos, uiOldLen, szNew, uiNewLen);
|
replace(dwPos, uiOldLen, szNew, uiNewLen);
|
||||||
|
|
||||||
//move up pos past the old string
|
//move up pos past the string that was replaced
|
||||||
dwPos += uiOldLen;
|
dwPos += uiNewLen;
|
||||||
|
|
||||||
//increase replace count
|
//increase replace count
|
||||||
++uiCount;
|
++uiCount;
|
||||||
|
@@ -476,8 +476,8 @@ void StringTestCase::Replace()
|
|||||||
CPPUNIT_ASSERT( s == wxString(r,rlen) ); \
|
CPPUNIT_ASSERT( s == wxString(r,rlen) ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_WXREPLACE( _T("null\0char"), 9, _T("c"), _T("d"), true,
|
TEST_WXREPLACE( _T("null\0char"), 9, _T("c"), _T("de"), true,
|
||||||
_T("null\0dhar"), 9 );
|
_T("null\0dehar"), 10 );
|
||||||
|
|
||||||
#undef TEST_WXREPLACE
|
#undef TEST_WXREPLACE
|
||||||
#undef TEST_NULLCHARREPLACE
|
#undef TEST_NULLCHARREPLACE
|
||||||
|
Reference in New Issue
Block a user