office-gobmx/basic
Stephan Bergmann cc20344010 tdf#111313: Honor bWriteNoLenParam in !bCompatibility, too
e8deba22e8 "INTEGRATION: CWS ab26" had added
the bCompatibility case with all the argument checking ("2006/05/04 08:33:46 ab
1.66.10.3: #111951# Changed Mid runtime behaviour only for
CompatibilityMode(true)"), and it was probably an oversight that, for
!bCompatibility, it left the bWriteNoLenParam case (triggered by Basic code like

  s = "abc"
  Mid(s,1) = "d"

) calling OUStringBuffer::remove with an illegal argument of len=-1.

Change that so that only setting ERRCODE_BASIC_BAD_ARGUMENT is controlled by
bCompatibility, while all the other checks (that are probably all necessary to
not call rtl string functions with illegal arguments) are done in both modes.

Also, the check

  nStartPos + 1 > nArgLen

should probably be

  nStartPos > nArgLen

instead, as nStartPos has already been decremented from the one-based Basic
index to the zero-baesd rtl string index.

Change-Id: I75deec0acf75b8677aa89f91897c06c1caa5614d
Reviewed-on: https://gerrit.libreoffice.org/52500
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-06 14:56:20 +02:00
..
inc drop unnecessary includes 2018-03-20 13:08:20 +01:00
qa Use for range loops in basegfx and basic 2018-02-24 17:28:43 +01:00
source tdf#111313: Honor bWriteNoLenParam in !bCompatibility, too 2018-04-06 14:56:20 +02:00
util
AllLangMoTarget_sb.mk
CppunitTest_basic_macros.mk
CppunitTest_basic_scanner.mk
Library_sb.mk basic, solve link problems 2018-01-08 13:18:36 +01:00
Makefile
Module_basic.mk
README

Contains the StarBASIC Interpreter

This implements a macro language that, when in VBA compatibility mode,
is intended to be interoperable with Visual Basic for Applications,
allowing people to run macros embedded in their documents.

See also:
[http://wiki.openoffice.org/wiki/Basic]