[Libreoffice-bugs] [Bug 132347] BASIC VBASupport=1 erroneously inherited by StrComp() in module without VBASupport
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Fri Jul 2 18:44:58 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=132347
Mike Kaganski <mikekaganski at hotmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |difficultyMedium, easyHack,
| |skillCpp
--- Comment #5 from Mike Kaganski <mikekaganski at hotmail.com> ---
All over the place, the current compatibility mode is tested in the code like
this:
SbiInstance* pInst = GetSbData()->pInst;
bool bCompatibility = pInst && pInst->IsCompatibility();
But SbiInstance::IsCompatibility is ~useless, as it's set to some "random"
value (unrelated to the currently executed function, current module opened in
IDE, and even last built module).
Instead, the code should ask for *current module* to detect its compatibility
mode - and the proper method to find the current module seems to be
StarBASIC::GetActiveModule.
So the places like SbRtl_StrComp should use something like this:
SbiInstance* pInst = GetSbData()->pInst;
SbModule* pMod = StarBASIC::GetActiveModule();
bool bCompatibility = pMod ? pMod->IsVBACompat() : pInst &&
pInst->IsCompatibility();
Whoever decides to fix the bug, should make sure to do that
function-by-function; and should provide unit tests for each such function.
This would require to create a mixed unit test, similar to what currently
basic/qa/cppunit/test_vba.cxx does, but its list of tests should possibly
contain pairs of source files (one with compat mode, one without) to load them
both, and test the resulting interaction.
--
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/20210702/f43b5dec/attachment.htm>
More information about the Libreoffice-bugs
mailing list