Bug 166336 - FILESAVE DOCX Word fails to open roundtripped document (issue with shape guides/glue points #2)
Summary: FILESAVE DOCX Word fails to open roundtripped document (issue with shape guid...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Tibor Nagy
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Shapes DOCX-Corrupted
  Show dependency treegraph
 
Reported: 2025-04-25 13:51 UTC by Aron Budea
Modified: 2025-04-30 10:43 UTC (History)
3 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 Aron Budea 2025-04-25 13:51:06 UTC
Open and save attachment 125302 [details] from bug 100072 back to DOCX, then try opening it in Word.

=> Word fails to open the file cleanly.

Observed using LO 25.8.0.0.alpha0+ (736998ccef0bacdd2bbf038c98dacfbe654f1a4d) / Windows.

If one:
- unzips the saved DOCX,
- executes the following command (can be done in Linux/Cygwin, needs xmllint installed): find . -name "*.xml" -type f -exec xmllint --output '{}' --format '{}' \;
- rezips the result with .docx extension

...then Word points to line 198 of /word/document.xml, which is the end of an <a:custGeom> element.
The interesting part seems to be this:
<a:gd name="GluePoint1X" fmla="*/ 0 w 284"/>
<a:gd name="GluePoint1Y" fmla="0*logwidth/284"/>
<a:gd name="GluePoint2X" fmla="*/ 284 w 284"/>
<a:gd name="GluePoint2Y" fmla="0*logwidth/284"/>

This is a regression from the following commit in 25.8 (and its 25.2 backport):
https://git.libreoffice.org/core/commit/612891865a74777950ab7355a4d794fa5577c5fc
https://cgit.freedesktop.org/libreoffice/core/commit/?id=612891865a74777950ab7355a4d794fa5577c5fc
author		Tibor Nagy <tibor.nagy.extern@allotropia.de>	Thu Mar 20 11:47:57 2025 +0100
committer	Nagy Tibor <tibor.nagy.extern@allotropia.de>	Thu Mar 20 16:49:11 2025 +0100

"tdf#165670 PPTX export: fix glue points export regression"

The similar XML part looks like this after exporting in a build preceding the regression:
<a:gd name="GluePoint1X" fmla="*/ 0 w 2"/>
<a:gd name="GluePoint1Y" fmla="*/ 0 h 285"/>
<a:gd name="GluePoint2X" fmla="*/ 285 w 2"/>
<a:gd name="GluePoint2Y" fmla="*/ 0 h 285"/>

The part in the original document's XML looks quite different, so it's hard to compare against that.
The document has a couple of other occurrences of this.

Issue seems to be related to bug 166335's, and probably the use of "logwidth" in the formula is the problem.

List of test files regressing from the same commit:
forum-mso-en-16850.docx
forum-mso-en3-17267.docx
forum-mso-en4-390463.docx
forum-mso-en-4456.docx
forum-mso-en-7940.docx
moz1197332-3.docx
moz1197332-4.docx
tdf100072-1.docx
tdf107442-1.docx
tdf112443-1.docx
tdf112450-5.docx
tdf112456-5.docx
tdf123435-2.docx
tdf99497-2.docx