summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-03-19 15:43:07 +0000
committerPetr Mladek <pmladek@suse.cz>2013-04-16 12:35:41 +0000
commit69371d3fae481adb2b21701952570f829fcd8311 (patch)
tree10d243224f1de8c6be5f692130392ef004a6875a /basic
parentdfe4974119bcd17fa65a5f0600fd12af02425c56 (diff)
fix for fdo#62090 Mid function regression
Change-Id: Ia6a73d6a44a34345b512922037d01b8b40ac24a8 (cherry picked from commit 14d452d0c2874f47f0b6ac1cd1c725195d5d69a9) Reviewed-on: https://gerrit.libreoffice.org/3408 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 858f84482856..7f724b1b6810 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1262,7 +1262,7 @@ 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(), std::min(nLen, rPar.Get(4)->GetOUString().getLength()));
}
rPar.Get(1)->PutString( aResultStr.makeStringAndClear() );