summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ) );
}
}