[Libreoffice-bugs] [Bug 132347] New: BASIC VBASupport=1 erroneously inherited by StrComp() in module without VBASupport
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Thu Apr 23 10:28:46 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=132347
Bug ID: 132347
Summary: BASIC VBASupport=1 erroneously inherited by StrComp()
in module without VBASupport
Product: LibreOffice
Version: 6.4.3.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: jp at ledure.be
Description:
When I run next Basic script:
Sub CompStr
Dim MyStr1, MyStr2, MyComp
MyStr1 = "ABCD": MyStr2 = "abcd"
MyComp = StrComp(MyStr1, MyStr2, 1) ' Returns 0 (VBA) / -1 (no VBA)
MyComp = StrComp(MyStr1, MyStr2, 0) ' Returns -1 (VBA) / 0 (no VBA)
MyComp = StrComp(MyStr2, MyStr1) ' Returns 1.
End Sub
the behaviour of the StrComp() builtin function, with its "Compare" argument
set, is different depending on the presence/absence on the top of the module of
Option VBASupport 1
See the comments after each line above. This is already annoying but I don't
see how to correct this without breaking backward compatibility with many
scripts.
However, THE REAL NEW BUG IS HERE:
When I store above script in a module WITHOUT VBASupport set, and I call it
from another module like this:
Option VBASUpport 1
Sub Comp_Str_Call
CompStr
End Sub
the CompStr routine bahaves as if the VBASupport in its module was set to 1,
which is not the case.
Steps to Reproduce:
1. Open TestStrComp.odt file
2. Open Basic IDE
3. 2 modules: NOVBA and VBA resp. with/without VBASupport
4. Step into (F8) the 3 proposed Subs
CompStr_NOVBASUPPORT in module NOVBA
CompStr_VBASUPPORT in module VBA
CompStr_Call_NOVBASUPPORT
while watching the variable MyComp in the watch window
Actual Results:
When running CompStr_Call_NOVBASUPPORT() the called sub CompStr_NOVBASUPPORT()
computes the results of the StrComp() function as if Option VBASupport 1 was
present.
Expected Results:
The results of StrComp() should be computed without VBASupport
Reproducible: Always
User Profile Reset: No
Additional Info:
Version: 6.4.3.2
Build ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: kf5;
Locale: fr-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200423/47d0fa84/attachment-0001.htm>
More information about the Libreoffice-bugs
mailing list