Bug Hunting Session
Bug 118242 - DOCX EXPORT: anchor of text frame is wrong + MSO can't open the file
Summary: DOCX EXPORT: anchor of text frame is wrong + MSO can't open the file
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: DOCX-Frames DOCX-Corrupted
  Show dependency treegraph
 
Reported: 2018-06-19 15:37 UTC by Patrick Jaap
Modified: 2019-06-28 13:19 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
ODT file cauing the bug (32.00 KB, application/vnd.oasis.opendocument.text)
2018-06-19 15:37 UTC, Patrick Jaap
Details
DOCX export of the sample file (24.06 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 15:38 UTC, Patrick Jaap
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Jaap 2018-06-19 15:37:09 UTC
Description:
Exporting the attached file (from odt) to docx sets the anchor of the text frame in the header to the body and additionally, MSO (2013) cannot open the file at all (displaying an import error)

A related regression was just fixed, see tdf#117805.

Steps to Reproduce:
1. Open Frames.odt in Writer
2. Export to docx
3. Open the docx in Writer/MSO

Actual Results:
Frame in header is now in body + Import error at MSO 2013

Expected Results:
Frame stays where it belongs and the file is not corrupted (for MSO)


Reproducible: Always


User Profile Reset: No



Additional Info:
You need a fresh master build from at least 19 July 2018 to reproduce
Comment 1 Patrick Jaap 2018-06-19 15:37:44 UTC
Created attachment 142920 [details]
ODT file cauing the bug
Comment 2 Patrick Jaap 2018-06-19 15:38:53 UTC
Created attachment 142921 [details]
DOCX export of the sample file
Comment 3 Xisco Faulí 2018-06-19 18:46:10 UTC Comment hidden (obsolete)
Comment 4 Patrick Jaap 2018-06-20 07:52:37 UTC
Hi Xisco!

I would not consider this as a regression. Commit 

853350787df9a8d92c269ef1b6e764863e74ec2a

from Miklos (from yesterday) fixes the related bug 

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

where there was no header at all in the same document export. The bug here is that the Writer export filter creates a corrupt docx file with a misplaced textframe. It seems this was never working correctly and it was "hidden" by the missing header.
Comment 5 Miklos Vajna 2018-06-20 12:44:13 UTC
Yes, basically there are 3 states:

- baseline: well-formed but not invalid output (but Writer can see the header)
- my earlier patch: valid output, but loosing header content
- my recent patch: restoring the header content

I agree with Patrick that exporting the header content in a valid way didn't work in the past either (for this situation).
Comment 6 Patrick Jaap 2018-06-26 08:15:47 UTC
I think the bug is caused by a missing header reference in the document.xml file. This should by the reason why Word refuses to open the file. The header reference (and the header file) are indeed created in sw/source/filter/ww8/docxexport.cxx:780.

But when the section properties are written in sw/source/filter/ww8/wrt8sty.cxx:1513 (called by sw/source/filter/ww8/docxattributeoutput.cxx:5900) the header reference is not present. 

Miklos gave me a hint that is has to do with postponing the output of the section properties in docxattributeoutput.cxx:5910. But I wasn't able to follow that trace. I think I am missing some background knowledge on this topic.
Comment 7 QA Administrators 2019-06-27 02:53:39 UTC Comment hidden (obsolete)
Comment 8 Patrick Jaap 2019-06-28 13:19:15 UTC
Situation is unchanged in current master