Bug 165503 - FILESAVE XLSX Chart is removed when roundtripped XLSX is opened in Excel
Summary: FILESAVE XLSX Chart is removed when roundtripped XLSX is opened in Excel
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All All
: medium normal
Assignee: Aron Budea
URL:
Whiteboard: target:25.8.0 target:25.2.2 target:25...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Chart XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2025-02-28 08:07 UTC by Aron Budea
Modified: 2025-03-10 08:46 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Sample XLSX (13.09 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-02-28 08:07 UTC, Aron Budea
Details
Sample screenshots (208.79 KB, image/jpeg)
2025-03-07 08:33 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-02-28 08:07:51 UTC
Created attachment 199525 [details]
Sample XLSX

The attached simple spreadsheet was created in Excel, it has date-value pairs, and a chart based on those values. Some of the date and/or value cells are empty.

Saved it back to XLSX, and try opening it in Excel.

=> Excel shows error, and after attempting repairs, chart is removed.
Message is: "Removed Part: /xl/drawings/drawing1.xml part.  (Drawing shape)"
(the problem has nothing to do with the drawing)

The issue is that in xl/charts/charts1.xml in the OOXML archive, dates under <c:numCache> are in string format, and not in numeric format, as expected by Excel, eg.:
- bad: <c:v>2021.01.03</c:v>
- good: <c:v>44199</c:v>

Observed using LO 25.8.0.0.alpha0+ (41ab24cecd6ad74312843f113d2faa13259cdb7d) / Windows.

This, like bug 156465, is a regression from the following commit in 7.3:
https://git.libreoffice.org/core/+log/f547cf17a179ebd7de5c2b4dd2d00d0027a25429
author		Dennis Francis <dennisfrancis.in@gmail.com>	Thu Sep 02 14:33:55 2021 +0530
committer	Miklos Vajna <vmiklos@collabora.com>	Mon Sep 06 08:47:50 2021 +0200

"[API CHANGE] oox: fix import of chart date categories"
Comment 1 Commit Notification 2025-03-03 04:41:08 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9d3fba976012b65e740c024e753f034600ce2852

tdf#165503 oox: save numerical date categories into numerical cache

It will be available in 25.8.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 2 Commit Notification 2025-03-03 08:31:29 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

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

tdf#165503 oox: save numerical date categories into numerical cache

It will be available in 25.2.2.

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 3 Timur 2025-03-07 08:33:21 UTC
Created attachment 199674 [details]
Sample screenshots

Thanks Aron for all-by-one here. 
Looks good to me, same in Excel, good in LO which has small visual differences, which seem another issue.
Comment 4 Commit Notification 2025-03-10 04:25:09 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165503: sc_subsequent_export_test4: Use precise XPath

It will be available in 25.8.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 5 Aron Budea 2025-03-10 05:03:22 UTC
(In reply to Timur from comment #3)
> Looks good to me, same in Excel, good in LO which has small visual
> differences, which seem another issue.
Thanks for retesting! The difference is due to a somewhat pathologic nature of the sample (the 15 standing by itself, not associated to a date), I wonder if there are real-life files like that. Must be very rare even if they exist.
Comment 6 Commit Notification 2025-03-10 08:46:52 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/4a2378d81c0ef174164797ad3a2d2a71a89447ba

tdf#165503: sc_subsequent_export_test4: Use precise XPath

It will be available in 25.2.3.

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.