summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-01-19 21:56:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-01-21 15:50:51 +0000
commitff48f28f71609b0ab4e6b8bc79818f765e48fddd (patch)
treea21ef16277d3e7034bb2c36a99c24b759fead8b4 /basic
parent840e7f004354ebe1239b9271dd758839c477ca7c (diff)
Resolves: fdo#73771 Non-standard behaviour for Function Mid
Change-Id: I90be516235228574dc219447a0eef3a34f83bee2 Reviewed-on: https://gerrit.libreoffice.org/7539 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 36d7c3cba782..efa3ea9d8c6b 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1302,7 +1302,8 @@ RTLFUNC(Mid)
{
nLen = aArgStr.getLength() - nStartPos;
}
- aResultStr = aArgStr.copy( nStartPos, nLen );
+ if (nLen > 0)
+ aResultStr = aArgStr.copy( nStartPos, nLen );
}
rPar.Get(0)->PutString( aResultStr );
}