[Libreoffice-bugs] [Bug 130661] New: MACRO setformula does not appear to work with array formula

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Feb 14 14:17:28 UTC 2020


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

            Bug ID: 130661
           Summary: MACRO setformula does not appear to work with array
                    formula
           Product: LibreOffice
           Version: 5.4.6.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: christophe.alviset at insee.fr

Description:
Hi
I am using array formulas. For some reason, while using macros or sorting or
something else, the array formulas go away and I am left with simple formulas
(ie SUM(...) instead of {SUM(...)}

I want to write a macro to reset these cells to array formulas, but setformula
does not seem to work with an array formula. It sets a string.

Thank you for looking

Christophe


Steps to Reproduce:
The data
Cells A1 contain 1, A2, 4, B1, 0, B2, 1.
Array formula {=SUM((A1:A2)*(B1:B2))} yields 4 while =SUM((A1:A2)*(B1:B2))
yields 0. This is fine

The macro instructions
oBug.getCellByPosition(2,0).setFormula("=SUM((A1:A2)*(B1:B2))")
has a cell type 3 (=FORMULA)
Whereas
oBug.getCellByPosition(2,0).setFormula("{=SUM((A1:A2)*(B1:B2))}")
has a cell type 2 (=STRING)

I did not find a way to set the cell type to FORMULA.



Actual Results:
cell type 2 (=STRING)

Expected Results:
cell type 3 (=FORMULA)


Reproducible: Always


User Profile Reset: No



Additional Info:
I am using the French Libreoffice version.

-- 
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/20200214/ee6b579f/attachment.htm>


More information about the Libreoffice-bugs mailing list