Bug 165655 - FILESAVE XLSX Excel fails to open exported file with incomplete drawing coming from VML
Summary: FILESAVE XLSX Excel fails to open exported file with incomplete drawing comin...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
6.4.5.2 release
Hardware: All All
: medium normal
Assignee: Aron Budea
URL:
Whiteboard: target:25.8.0
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: OOXML-Shapes XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2025-03-09 16:57 UTC by Aron Budea
Modified: 2025-04-01 01:42 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample XLSX (minimal) (11.25 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-03-09 16:57 UTC, Aron Budea
Details
forum-mso-de-99515.xlsx (47.82 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-03-09 16:59 UTC, Aron Budea
Details
Another example from Calc with Textbox form control (9.31 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-03-12 20:57 UTC, Gabor Kelemen (allotropia)
Details
The ods file saved as xlsx with current master (5.77 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-03-12 20:59 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-03-09 16:57:53 UTC
Created attachment 199710 [details]
Sample XLSX (minimal)

The attached XLSX was created in Excel as a minimal reproducer from forum-mso-de-99515.xlsx (attaching both). Open the file in Calc, save it back into XLSX, and open it in Excel.

=> Excel shows error. After attempting repairs, seemingly all is fine.
Message is: "Repaired Records: Drawing from /xl/drawings/drawing1.xml part (Drawing shape)"

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

This is a regression/implementatino error from the following commit in 7.0, and its backport in 6.4:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=fd238380ae7820f12ac1f7c52d0f7180a93f3ba3
https://git.libreoffice.org/core/commit/fd238380ae7820f12ac1f7c52d0f7180a93f3ba3
author		Serge Krot <Serge.Krot@cib.de>	2020-05-13 22:52:52 +0200
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2020-05-26 00:20:54 +0200

"tdf#106181 XLSX export: output form controls"

The OOXML archive contains an xl\drawings\drawing1.xml file with drawingML, and an xl\drawings\vmlDrawing1.vml file with VML. These are both referenced in sheet1.xml. The VML is some sort of dropdown (ObjectType is "Drop") that isn't shown in either Excel or Calc. Calc reads both drawingML and VML, and since the commit mentioned above, also writes it into the exported drawingML. Or at least part of it, basically an anchor to/from, and nothing else. This is what Excel doesn't like.
Comment 1 Aron Budea 2025-03-09 16:59:03 UTC
Created attachment 199711 [details]
forum-mso-de-99515.xlsx
Comment 2 Gabor Kelemen (allotropia) 2025-03-12 20:57:56 UTC
Created attachment 199774 [details]
Another example from Calc with Textbox form control

I noticed another angle of this issue: if some from control is inserted from the Insert - Form Control that does not have an equivalent in Excel (among the Form Controls, not counting ActiveX here), then it will end up with the same unreadable content, then the drawing.xml was repaired message. 

The Control is not visible in Calc/Excel either, but that was the same in 6.4 - just no broken XML warning.

Source commit is the same.
Comment 3 Gabor Kelemen (allotropia) 2025-03-12 20:59:02 UTC
Created attachment 199775 [details]
The ods file saved as xlsx with current master

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bff3d755c8c11721054f4ff40a3d5f723b0c6b96
CPU threads: 14; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded
Comment 4 Aron Budea 2025-03-13 02:38:41 UTC
I have a fix on gerrit that resolves both cases: https://gerrit.libreoffice.org/c/core/+/182699

The control won't get exported, so the behavior goes back to the state before the identified commit for controls that don't have exporter.
Comment 5 Commit Notification 2025-03-31 19:58:34 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165655 oox: don't export incomplete shape data coming from VML

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.