[Libreoffice] Same expression on both sides of '!=' in calc.

Kohei Yoshida kyoshida at novell.com
Sat May 7 12:46:50 PDT 2011

On Sat, 2011-05-07 at 20:15 +0100, Michael Meeks wrote:
> On Sat, 2011-05-07 at 13:03 -0430, Rafael Dominguez wrote:
> > Well it does look weird, but its the same object getting compared on
> > both sides, so i think theres a problem there, but better wait for
> > someone with more experience in the code say something about it.
> 	In libreoffice-3-3 we had:
>         ::formula::FormulaGrammar::AddressConvention eConvUI = pDocument->GetAddressConvention();
>         if (eConv != eConvUI)
>             return ((rAddress.Parse(sToken, const_cast<ScDocument*>(pDocument), eConvUI) & SCA_VALID) == SCA_VALID);
> #endif
> 	Around here instead of:
>             if (!bResult && eConv != eConv)
>                 bResult = ((rRange.aStart.Parse(
>                     aUIString, const_cast<ScDocument*>(pDocument), eConv) & SCA_VALID) == SCA_VALID);
> 	It seems pretty bogus doing the same parse again - you would hope the
> function would fail in the same way :-)

The second parse is supposed to be done with eConvUI, and the if
statement is supposed to compare eConv vs eConvUI.  And the line 

::formula::FormulaGrammar::AddressConvention eConvUI =

is missing in those places where the eConv != eConv condition is

This code was placed as a workaround to a bug where the chart addresses
were unintentionally saved using the current UI address convention,
where they were supposed to be saved using the Calc A1 address
convention at all times.  This code was initially placed probably around
the Go-OO 3.2 release, but I don't remember the exact release.

The idea was to keep that code for several releases, and eventually
remove it, which is why it was guarded with the big and bold
CHART_ADDRESS_CONV_WORKAROUND macro guard.  But alas, now that macro
guard is taken away...


Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida at novell.com>

More information about the LibreOffice mailing list