summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-01-19 21:56:40 +0100
committerMichael Stahl <mstahl@redhat.com>2014-01-22 22:05:43 +0000
commit04ad856f79de3f2987b8e23ce9d12c1cdaa73dd0 (patch)
tree7fe1fd6f6891453116fe715ad6147876385d7b47
parentb00aee5aa776c99940d858a8b73557612a558d01 (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> (cherry picked from commit ff48f28f71609b0ab4e6b8bc79818f765e48fddd) Reviewed-on: https://gerrit.libreoffice.org/7579 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-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 200b7b749759..31825c8277dc 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1308,7 +1308,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 );
}