https://bugs.documentfoundation.org/show_bug.cgi?id=170516

            Bug ID: 170516
           Summary: FILESAVE DOCX: corrupt document (sometimes) reported
                    by MS Word when plainText Sdt contains drawing
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: bisected, filter:docx
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
            Blocks: 104528

Created attachment 205228
  --> https://bugs.documentfoundation.org/attachment.cgi?id=205228&action=edit
forum-mso-en-16671.docx: example document

MS Word generally doesn't like complex content inside of a plainText content
control. Although bug 165359 shows us that it IS possible to have graphics and
shapes inside a plainText control, under some circumstances it can be reported
as corrupt (where it is not corrupt if the control has the <w:text/> marker
removed).

Steps to reproduce:
-open forum-mso-en-16671.docx in LO and resave it.
-open the resaved file in Microsoft Word  (file reported as broken)

I bisected this back to 7.6 commit c804c5354855188b5a37219cfe11dc079dc235f4
Author: Miklos Vajna on Fri Mar 10 17:32:07 2023 +0000
    sw content control: fix lost properties on copy&paste
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148613

However, his commit just restored the missing SdtPr values (including the
w:text), so it just exposed an existing weakness.

In this case, the floating graphics are anchored at the start of the paragraph.
Normally the code writes the graphics first (1), in a separate run. But in this
case, because this is all in a floating table, that code path was not followed,
and the SDT was started before the graphics were written out.

(1) flies processed first/text postponed with
commit 80fd9fb7209cfd5c0622ee99d59e42e6db32f021
Author:     Umesh Kadam on Thu May 22 02:31:53 2014 -0500
    fdo#78333 : SdtContent and a Shape overlapping causes corruption
    Reviewed-on: https://gerrit.libreoffice.org/9374


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104528
[Bug 104528] [META] Saved DOCX files that MS Word can't open
-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to