Open and save attachment 53318 [details] from bug 42736 or attachment 125030 [details] from bug 99822 back to DOCX, then try opening the result in Word. => Word fails to open the files cleanly. If one: - unzips the saved DOCX, - executes the following command (can be done in Linux/Cygwin, needs xmllint installed): find . \( -name "*.xml" -o -name "*.rels" \) -type f -exec xmllint --output '{}' --format '{}' \; - rezips the files with DOCX extension, Word points to the ending '</w:sdt>' element in the respective XMLs containing the content controls. This is a regression from the following commit in 24.8 and its backport to 24.2: https://git.libreoffice.org/core/commit/13a11632014ccc27199667c6a1e313f8ff616d6d author Mike Kaganski <mike.kaganski@collabora.com> Mon Jan 22 19:10:29 2024 +0600 committer Mike Kaganski <mike.kaganski@collabora.com> Tue Jan 23 05:33:42 2024 +0100 "tdf#159259: make sure to set FieldStartRange in sdt helper" Affected bugdocs: abi13887-1.docx fdo42736-1.docx forum-mso-de-88566.docx forum-mso-de-88567.docx forum-mso-en-11890.docx forum-mso-en-12392.docx forum-mso-en-1852.docx forum-mso-en-3607.docx forum-mso-en-4096.docx lp1193316-1.docx tdf99822-1.docx
The problem with 'table_text.docx' is the empty <w:text/> entry. Same with 6.docx.
(In reply to Justin L from comment #1) > The problem is the empty <w:text/> entry. Well that is not exactly true, because w:text is ALWAYS empty. ChatGPT was helpful here. Apparently there can only be ONE w:r inside a plaintext control. (I.E. all of the content inside is formatted identically - and that makes sense based on the definition of what plaintext is.) Removing the w:text means it gets treated as a rich text control - so allowed to have multiple 'runs' of formatting - as well as multiple paragraphs etc.
Created attachment 205047 [details] A Plain text control.docx: with different formatting and multiple w:t runs (In reply to Justin L from comment #2) > Apparently there can only be ONE w:r inside a plaintext control. That's also not true. Probably the key here is to force any SDT containing a field to be a richtext control. That would make sense anyway, since anything that contains a field is not 'simple'.
Should be solved by import-adjusting https://gerrit.libreoffice.org/c/core/+/197300, but when saving I hit a debug assert - so I must have been lucky enough to hit some other content-control export failure. Hurray.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2eed35dcb721ebce08460b0e72a770336baf806d tdf#170322 writerfilter: import fields into richText, not plainText It will be available in 26.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.
justin.luth@collabora.com committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3f4d026f7a2fbc6c5341dbfa69052b6ce82c14df tdf#170322 docx export: close blockSDT when frame is done It will be available in 26.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.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/f4f038fc9a7602e62065ee820f7a3e4fc78f290f tdf#170322 writerfilter: import fields into richText, not plainText It will be available in 26.2.1. 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.
justin.luth@collabora.com committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/3c552ee36404717735c1b4fa68ee4e50516592d7 tdf#170322 docx export: close blockSDT when frame is done It will be available in 26.2.1. 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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2315f0fe9ef1f94634d1a8944203b234170becf7 tdf#170322 docx export: explain why unit test checks for <w:text/> It will be available in 26.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/52c6bbfc381c37ea6400f768f7d4773da9ba6873 tdf#170322 writerfilter: if dataBinding, then not richText It will be available in 26.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.