summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-08 20:35:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-08 20:35:35 +0000
commit869402a58720b45e7227438b2e56e5a9532c0000 (patch)
tree231c574b04be2428be8f2627fad47e658b6d0f68 /basic
parent1c67621d53e0b2cbeb6f0fc37bf66c1bc3b2a0eb (diff)
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
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx4
1 files 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 ) );
}
}