Bug 161771 - Exporting a content control with an empty value to DOCX produces a document unreadable in Word
Summary: Exporting a content control with an empty value to DOCX produces a document u...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:25.2.0 target:24.8.0.2
Keywords: filter:docx
Depends on:
Blocks: DOCX-Content_Control
  Show dependency treegraph
 
Reported: 2024-06-25 06:21 UTC by Mike Kaganski
Modified: 2024-07-09 14:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
An SDT with a dropdown with an empty value (607 bytes, application/vnd.oasis.opendocument.text)
2024-06-25 06:21 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-06-25 06:21:13 UTC
Created attachment 194941 [details]
An SDT with a dropdown with an empty value

Open the attached document in Writer, and save as a DOCX. The resulting DOCX produces an error when opening in MS Word:

> Word experienced an error trying to open the file.

The empty values are possible in Writer, but impossible in Word. Making the value attribute in the DOCX to be a space " " fixes the problem.
Comment 1 J_A 2024-06-25 10:39:54 UTC
Hello Mike Kaganski,

Thank you for reporting the bug. I can confirm that the bug is present in the master version.

Tested using:
Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 2 Miklos Vajna 2024-06-28 12:46:01 UTC
This is related to bug 161708, let me see.
Comment 3 Commit Notification 2024-07-08 13:01:33 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/62fb52cd43d7c0d41dd4e35a1c128947b6a14918

tdf#161771 sw content controls: fix DOCX export of empty dropdown list item

It will be available in 25.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 4 Commit Notification 2024-07-09 14:19:22 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#161771 sw content controls: fix DOCX export of empty dropdown list item

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