basic/source/runtime/methods.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit 0054b438013ef412c2df3b7ebe93dd1935ec07af Author: Noel Power <noel.po...@suse.com> Date: Tue Mar 19 15:59:21 2013 +0000 follow on fix for fdo#62090 ensure out of range startpos is handled Change-Id: Ic1f57480a36415998748faeea3b606a47d277181 diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 12dfff2..750d7c3 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1265,8 +1265,12 @@ RTLFUNC(Mid) else { aResultStr = aArgStr; - aResultStr.remove( nStartPos, nLen ); - aResultStr.insert( nStartPos, rPar.Get(4)->GetOUString().getStr(), std::min(nLen, rPar.Get(4)->GetOUString().getLength())); + sal_Int32 nTmpStartPos = nStartPos; + if ( nTmpStartPos > aArgStr.getLength() ) + nTmpStartPos = aArgStr.getLength(); + else + aResultStr.remove( nTmpStartPos, nLen ); + aResultStr.insert( nTmpStartPos, rPar.Get(4)->GetOUString().getStr(), std::min(nLen, rPar.Get(4)->GetOUString().getLength())); } rPar.Get(1)->PutString( aResultStr.makeStringAndClear() ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits