summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 5dc45ed0be71..862f4d00aea4 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1266,7 +1266,8 @@ RTLFUNC(Mid)
{
aResultStr = aArgStr;
aResultStr.remove( nStartPos, nLen );
- aResultStr.insert( nStartPos, rPar.Get(4)->GetOUString().getStr(), nLen);
+ //aResultStr.insert( nStartPos, rPar.Get(4)->GetOUString().getStr(), nLen);
+ aResultStr.insert( nStartPos, rPar.Get(4)->GetOUString().getStr(), std::min(nLen, rPar.Get(4)->GetOUString().getLength()));
}
rPar.Get(1)->PutString( aResultStr.makeStringAndClear() );