Bug 147955 - FILEOPEN XLSX with formulas (=number) displays as zero
Summary: FILEOPEN XLSX with formulas (=number) displays as zero
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0 all versions
Hardware: All All
: medium minor
Assignee: Eike Rathke
URL:
Whiteboard: target:24.2.0 target:7.6.1
Keywords: filter:xlsx
Depends on:
Blocks: XLSX-External-Generators
  Show dependency treegraph
 
Reported: 2022-03-13 05:52 UTC by Oliver Elphick
Modified: 2023-08-03 10:55 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
XLSX file generated by QuickBooks (4.13 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2022-03-13 05:52 UTC, Oliver Elphick
Details
Comparison LibreOffice 7.4 master and Excel 2016 (109.31 KB, image/png)
2022-03-28 09:28 UTC, Xisco Faulí
Details
sample file saved with Excel 2016 (9.17 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2022-03-28 09:30 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Elphick 2022-03-13 05:52:39 UTC
Created attachment 178854 [details]
XLSX file generated by QuickBooks

The attached XLSX file was generated by QuickBooks. In Excel it is supposed to load as a non-editable file. In LibreOffice it is editable immediately. In addition all the numeric fields are (for some reason!) the formula =123 rather than just 123 and when opened in LibreOffice they show as zero and are totalled as zero.

When such a field is edited and changed (add a space or decimal point) it becomes visible.

The default setting for Recalculate on load was "Never recalculate". When changed to "Always recalculate", the display problem goes away. However the file still loads as editable when it should be read only.
Comment 1 Xisco Faulí 2022-03-28 09:28:03 UTC
Created attachment 179158 [details]
Comparison LibreOffice 7.4 master and Excel 2016
Comment 2 Xisco Faulí 2022-03-28 09:28:35 UTC
Reproduced in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 4a46a74a3de0ac7df5d3ce949dda5e809c1729ab
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2022-03-28 09:29:16 UTC
Also reproduced in

Version: 6.0.0.0.alpha1+
Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3; 
Locale: es-ES (es_ES.UTF-8); Calc: group threaded
Comment 4 Xisco Faulí 2022-03-28 09:30:31 UTC
Created attachment 179159 [details]
sample file saved with Excel 2016

The issue is not reproducible after resaving the document with Excel 2016
Comment 5 Xisco Faulí 2022-03-28 09:31:52 UTC
Also reproduced in

Version 4.0.0.3 (Build ID: 7545bee9c2a0782548772a21bc84a9dcc583b89)
Comment 6 Eike Rathke 2023-07-26 15:35:33 UTC
(In reply to Oliver Elphick from comment #0)
> all the numeric fields are (for some reason!) the formula =123
> rather than just 123 and when opened in LibreOffice they show as zero and
> are totalled as zero.
Because that QuickBooks (via Apache POI) generator had the document written with formula cells instead of value cells and also claimed the results to be 0.0 for each formula cell. Hence all cells display 0 until recalculated.

> However the
> file still loads as editable when it should be read only.
Nothing in the attached document says it should be read-only.
Comment 7 Commit Notification 2023-07-26 18:30:18 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ec912956903b2657f4a6b67a68c2687e8be32508

Resolves: tdf#147955 Recalculate OOXML for bad generators with all 0.0 results

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Eike Rathke 2023-07-26 18:44:59 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/154953 for 7-6
Comment 9 Commit Notification 2023-07-27 11:29:46 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/69184e2eff8eeb1f2a0b10279c1d08f70b2e7000

Resolves: tdf#147955 Recalculate OOXML for bad generators with all 0.0 results

It will be available in 7.6.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2023-08-03 10:55:10 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0e4429983eb73c8e0ce27feb3c5fa35bead64b88

tdf#147955: sc_subsequent_filters_test4: Add unittest

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.