Bug 127808 - Add dynamic arrays in to Calc
Summary: Add dynamic arrays in to Calc
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Enhancements 161399 161470 161642
  Show dependency treegraph
 
Reported: 2019-09-27 06:52 UTC by Roman Kuznetsov
Modified: 2024-07-10 19:39 UTC (History)
14 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2019-09-27 06:52:22 UTC
Description:
Add dynamic arrays in to Calc like in Excel https://techcommunity.microsoft.com/t5/Excel-Blog/Preview-of-Dynamic-Arrays-in-Excel/ba-p/252944

Steps to Reproduce:
-

Actual Results:
we can't make dynamic arrays in the Calc

Expected Results:
we can make dynamic arrays in the Calc


Reproducible: Always


User Profile Reset: No



Additional Info:
-
Comment 1 Xisco Faulí 2019-10-14 15:08:39 UTC
Makes sense. Moving to NEW
Comment 2 Regina Henschel 2024-06-25 22:43:00 UTC
I had a look at how Excel saves the "dynamic array" feature. Here are my (hopefully correct) results. They may be helpful for those who implement the feature.

The xlsx-file has a global switch in metadata.xml to determine whether the "dynamic array" feature should be used at all. It is located in the <futureMetadata> element and there in the <xda:dynamicArrayProperties> chil delement, namely its ´fDynamic´ attribute. This <futureMetadata> element is linked to a <metadataType> element via the ´name´ attribute. This <metadataType> element contains the ´minSupportedVersion´ attribute, among others. For the "dynamic array" feature to be used at all in the document, fDynamic="1" must be set.

A formula is contained as <f> element in the top left cell of its output area, also for CSE (Ctrl+Shift+Enter) formulas. If the formula is to create a "dynamic array", this cell has a ´cm´ attribute (18.3.1.4, Part 1, OOXML standard) that refers to the <futureMetadata> element. The ´cm´ attribute uses a zero-based index. In the example I examined, there was also a <cellMetadata> element, which is probably assigned the index value 0. In any case, ´cm="1"´ had to be set for the cell which contains the formula to have a "dynamic array" as output in my example.

The fact that a "dynamic array" is generated is not limited to the new functions SORT, RANDARRAY, etc. For example, =ISBLANK(D12:F16) also generates a "dynamic array". In addition to the missing {} - which are used in the CSE case - you can recognize a "dynamic array" in the UI in Excel by the special frame that is shown around the array when a cell in the array is the active cell.

When importing with SheetDataContext::importCell(), the ´cm´ attribute is ignored and the ´CellModel´ struct used for ´maCellData´ does not even have a component for it. I don't know whether the <futureMetadata> element is currently evaluated at all.


BTW: If someone is going to implement this feature, please contact the ODF TC as early as possible.