Bug 168567 - FILESAVE DOCX Content controls embedding each other in table end up in page header, creating invalid document error in Word
Summary: FILESAVE DOCX Content controls embedding each other in table end up in page h...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Karthik
URL:
Whiteboard: target:26.2.0 target:25.8.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Corrupted DOCX-Content_Control
  Show dependency treegraph
 
Reported: 2025-09-26 19:18 UTC by Gabor Kelemen (Collabora)
Modified: 2025-10-27 09:37 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Minimized example file from Word 2016 (35.60 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-09-26 19:18 UTC, Gabor Kelemen (Collabora)
Details
The example file saved with Writer master (29.13 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-09-26 19:18 UTC, Gabor Kelemen (Collabora)
Details
The original file in Word, the saved one in Writer and the error message from Word (64.87 KB, image/png)
2025-09-26 19:19 UTC, Gabor Kelemen (Collabora)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (Collabora) 2025-09-26 19:18:22 UTC
Created attachment 202984 [details]
Minimized example file from Word 2016

Attached user made, minimized file contains a table with content controls embedding each other.

When roundtripped in Writer, the resulting file can not be opened in Word.

1. Open attached document
2. Save as docx
3. Open the resulting docx in Word

-> Invalid content is detected in the header.

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4ba94c18b2ebf1872d1db1f03857172e9a114917
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

Seems to have started in 24.2 with:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=7c4dba1deffd81f647a4a3be7a79f68f3bf9f1

author	Jaume Pujantell <jaume.pujantell@collabora.com>	2023-11-22 11:59:09 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	2023-11-23 08:27:57 +0100
commit 7c4dba1deffd81f647a4a3be7a79f68f3bf9f1ba (patch)

fix a regression crash from commit 5082d50
Comment 1 Gabor Kelemen (Collabora) 2025-09-26 19:18:45 UTC
Created attachment 202985 [details]
The example file saved with Writer master
Comment 2 Gabor Kelemen (Collabora) 2025-09-26 19:19:18 UTC
Created attachment 202986 [details]
The original file in Word, the saved one in Writer and the error message from Word
Comment 3 Xisco Faulí 2025-10-24 16:03:15 UTC
a fix for this issue is already available in Collabora's branch <https://git.libreoffice.org/core/+/72a326b2899115860a87cfa55b82f745a76128da%5E%21> but it hasn't been cherry-picked to master yet
Comment 4 Michael Stahl 2025-10-24 18:51:03 UTC
thanks Karthik for fixing this
Comment 5 Commit Notification 2025-10-24 18:51:49 UTC
Karthik Godha committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2444243cab5f49fdec77de332491e9ae5c57b0f4

tdf#168567: Fix import of SDTs with empty content

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.
Comment 6 Commit Notification 2025-10-27 09:37:54 UTC
Karthik Godha committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

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

tdf#168567: Fix import of SDTs with empty content

It will be available in 25.8.4.

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.