From 340ca294d43f2c5b9fda1afbf178609a015f71e3 Mon Sep 17 00:00:00 2001 From: Tsutomu Uchino Date: Thu, 8 Jan 2015 12:56:45 +0000 Subject: Resolves: #i94895# fix illegal result of Replace runtime function (cherry picked from commit a2700f75af61837033ff213607445cc1f74b36d6) Conflicts: basic/source/runtime/methods.cxx Change-Id: If9c671a612de87d8d37bfc40704a97a6062fd150 --- 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 7ccbab73430d..baa9603afbae 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 - nFindStrLen + nReplaceStrLen + 1; + nPos = nPos + nReplaceStrLen; nCounts++; } else @@ -1414,7 +1414,7 @@ RTLFUNC(Replace) } } } - rPar.Get(0)->PutString( aExpStr.copy( lStartPos - 1 ) ); + rPar.Get(0)->PutString( aExpStr ); } } -- cgit v1.2.3