From 869402a58720b45e7227438b2e56e5a9532c0000 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 8 Jan 2015 20:35:28 +0000 Subject: Revert "Resolves: #i94895# fix illegal result of Replace runtime function" This reverts commit 340ca294d43f2c5b9fda1afbf178609a015f71e3 as CppunitTest_basic_vba breaks, so needs revisiting to see which is right Change-Id: I10168d454a8c67d91eee5bb8939aff74bba42954 --- basic/source/runtime/methods.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index baa9603afbae..7ccbab73430d 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1405,7 +1405,7 @@ RTLFUNC(Replace) if( nPos >= 0 ) { aExpStr = aExpStr.replaceAt( nPos, nFindStrLen, aReplaceStr ); - nPos = nPos + nReplaceStrLen; + nPos = nPos - nFindStrLen + nReplaceStrLen + 1; nCounts++; } else @@ -1414,7 +1414,7 @@ RTLFUNC(Replace) } } } - rPar.Get(0)->PutString( aExpStr ); + rPar.Get(0)->PutString( aExpStr.copy( lStartPos - 1 ) ); } } -- cgit v1.2.3