https://bugs.documentfoundation.org/show_bug.cgi?id=132347

Mike Kaganski <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |difficultyMedium, easyHack,
                   |                            |skillCpp

--- Comment #5 from Mike Kaganski <[email protected]> ---
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.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to