Bug 168885 - FILESAVE DOCX Empty charts get saved incompletely
Summary: FILESAVE DOCX Empty charts get saved incompletely
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium normal
Assignee: Aron Budea
URL:
Whiteboard: target:26.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Chart DOCX-Corrupted
  Show dependency treegraph
 
Reported: 2025-10-16 09:38 UTC by Aron Budea
Modified: 2025-10-17 13:12 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Sample ODT with empty charts (26.06 KB, application/vnd.oasis.opendocument.text)
2025-10-16 09:38 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-10-16 09:38:58 UTC
Created attachment 203352 [details]
Sample ODT with empty charts

The attached document, which is based on attachment 159766 [details] from bug 132279 has a couple of empty charts of different types (area, bar, bubble, line, stock). Save it into DOCX, and try opening it in Word.

=> Word can't open the file cleanly. While Word offers no error details, OOXML-Validator gives errors like this for each of the chartX.xml in the archive:

{"Description":"The element has unexpected child element 'http://schemas.openxmlformats.org/drawingml/2006/chart:spPr'. List of possible elements expected: <http://schemas.openxmlformats.org/drawingml/2006/chart:layout>.","Path":{"Namespaces":{},"XPath":"/c:chartSpace[1]/c:chart[1]/c:plotArea[1]","PartUri":"/word/charts/chart1.xml"},"Id":"Sch_UnexpectedElementContentExpectingComplex","ErrorType":"Schema"}

It also gives errors like this for fontTable.xml, but that doesn't prevent the file from opening cleanly in Word, so I'm disregarding this error for now:

{"Description":"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:characterSet' has invalid value 'windows-1252'. The Enumeration constraint failed.","Path":{"Namespaces":{},"XPath":"/w:fonts[1]/w:font[4]/w:charset[1]","PartUri":"/word/fontTable.xml"},"Id":"Sch_AttributeValueDataTypeDetailed","ErrorType":"Schema"}

The problem with opening the file started with the following commit in 7.2:
https://git.libreoffice.org/core/commit/3b4c11350a631e27345e87ecfe258d12983cbfbc
https://cgit.freedesktop.org/libreoffice/core/commit/?id=3b4c11350a631e27345e87ecfe258d12983cbfbc
author		Balazs Varga <balazs.varga991@gmail.com>	Tue Jun 08 09:24:48 2021 +0200
committer	Balazs Varga <varga.balazs3@nisz.hu>	Thu Jun 10 14:01:52 2021 +0200

"tdf#142713 OOXML: export secondary axis of all chart types"

After this commit, some important elements aren't saved into OOXML in case of these types of empty charts.
Comment 1 Commit Notification 2025-10-17 13:10:53 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

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

tdf#168885 oox: save more of empty charts

It will be available in 26.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.