Hi, On 07.06.2020 3:50, Michael wrote:
I was looking at TDF 133647 <https://bugs.documentfoundation.org/show_bug.cgi?id=133647>, and I guess, taking a step back, I'm not sure why there is an SwCalc class at all. Shouldn't LibreOffice Writer be leveraging code from sc for computing the result of a formula in a table?
I also used to think that way; and of course, it seems like that would be great at the first glance. But actually, the formula in Writer's table is just a specific case of more general formula in Writer - and these formulas may appear in multiple places. E.g., in Insert Formula, Set Variable and other fields' Value; in Hidden text/paragraph or Database fields' Conditions; in sections' conditions. All them should behave consistently, allow using document properties, and allow to refer to others - like referring from a table cell to variables set somewhere in the document. [1] [2] Formulas in tables only add references to other cells (including between tables), but share the same syntax. If one would consider changing to Calc engine for computations, many aspects would need to be addressed, including compatibility. But in any case, the problem in tdf#133647 seems to be import/export one, where syntax like sum(1,2,3) must be converted to sum 1|2|3. It doesn't need changing SwCalc class itself. [1] https://help.libreoffice.org/6.4/en-US/text/swriter/01/04090200.html [2] https://help.libreoffice.org/6.4/en-US/text/swriter/02/14020000.html -- Best regards, Mike Kaganski
Attachment:
pEpkey.asc
Description: application/pgp-keys