Bug 115556 - FILESAVE DOCX Shapes in footnotes cause SAXParseException error when the document is saved as DOCX
Summary: FILESAVE DOCX Shapes in footnotes cause SAXParseException error when the docu...
Status: RESOLVED DUPLICATE of bug 107969
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: DOCX-SAXParse DOCX-Corrupted DOCX-Footnote-Endnote
  Show dependency treegraph
 
Reported: 2018-02-08 17:28 UTC by Gabor Kelemen
Modified: 2019-05-28 13:04 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The example file saved by LO (15.45 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-02-08 17:28 UTC, Gabor Kelemen
Details
The error message when the file is opened by LO (18.48 KB, image/png)
2018-02-08 17:29 UTC, Gabor Kelemen
Details
The error message when the file is opened by Word 2013 (7.07 KB, image/png)
2018-02-08 17:29 UTC, Gabor Kelemen
Details
test document for bibisecting (10.30 KB, application/vnd.oasis.opendocument.text)
2019-05-28 07:52 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen 2018-02-08 17:28:37 UTC
Created attachment 139700 [details]
The example file saved by LO

Shapes in footnotes cause corrupted files when the document is saved as DOCX. 
Insert a shape in a footnote, save the file as DOCX and try to reopen the file.
We get the following error message:
File format error found at SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word/document.xml', Line 2, Column 2231(row,col).

Steps to reproduce:
1. Create a new document in LibreOffice Writer.
2. Create a short text document with multiple footnotes.
3. Insert a shape in one of the footnotes.
4. Save the document as DOCX.
5. Try to reload the file.

Actual results:
The file opens, but the user gets an error message in LO.
In Word 2013, we get an error message saying "There must be exactly one root element in documents".

Expected results:
A shape in a footnote shouldn't result a corrupted DOCX file.

Note: Word 2013 does not allow inserting shapes in a footnote - the button is greyed out.
Comment 1 Gabor Kelemen 2018-02-08 17:29:13 UTC
Created attachment 139701 [details]
The error message when the file is opened by LO
Comment 2 Gabor Kelemen 2018-02-08 17:29:33 UTC
Created attachment 139702 [details]
The error message when the file is opened by Word 2013
Comment 3 Aron Budea 2018-02-10 18:00:51 UTC
Confirmed with LO 6.0.1.1 / Windows 7.
Comment 4 Xisco Faulí 2018-02-27 12:14:53 UTC
Also reproduced in

Version: 5.0.0.0.alpha1+
Build ID: 0db96caf0fcce09b87621c11b584a6d81cc7df86
Locale: ca-ES (ca_ES.UTF-8)

@Mike, I thought you might be interested in this...
Comment 5 László Németh 2019-05-28 06:01:26 UTC

*** This bug has been marked as a duplicate of bug 99227 ***
Comment 6 Mike Kaganski 2019-05-28 06:08:53 UTC
(In reply to László Németh from comment #5)

Hmm... making a bug filed in 2018, confirmed with 6.0 in comment 3, a duplicate for a bug fixed in 2016 for 5.4?
Comment 7 Mike Kaganski 2019-05-28 06:43:15 UTC
Given that docProps/app.xml of attachment 139700 [details] tells that generating application was LibreOffice 6.0.0.3 for Windows_x86, this can't be a dupe of tdf#99227. But the attachment itself is useless; and steps aren't specific enough, so I couldn't repro. A normal ODT is needed, which would produce invalid DOCX on export.
Comment 8 László Németh 2019-05-28 07:52:28 UTC
Created attachment 151724 [details]
test document for bibisecting
Comment 9 László Németh 2019-05-28 07:55:11 UTC
(In reply to Mike Kaganski from comment #7)
> Given that docProps/app.xml of attachment 139700 [details] tells that
> generating application was LibreOffice 6.0.0.3 for Windows_x86, this can't
> be a dupe of tdf#99227. But the attachment itself is useless; and steps
> aren't specific enough, so I couldn't repro. A normal ODT is needed, which
> would produce invalid DOCX on export.

Thanks, Mike, I detected the fix in the recent master, and it seemed, this was your fix, but it seems, it's not. Likely we will make a bibisect to fix the bug number in the duplicate field.
Comment 10 Xisco Faulí 2019-05-28 08:18:19 UTC
Putting it back to NEW since the document has been provided...
Comment 11 Mike Kaganski 2019-05-28 08:19:34 UTC
I am sorry, but could we *please* wait for OP comment here, if the document provided by other people indeed shows that specific problem or not?
Comment 12 Xisco Faulí 2019-05-28 08:28:48 UTC
(In reply to Mike Kaganski from comment #11)
> I am sorry, but could we *please* wait for OP comment here, if the document
> provided by other people indeed shows that specific problem or not?

in this particular case, Gabor and László are part of the same team, I assume the document provided is fine
Comment 13 Mike Kaganski 2019-05-28 08:30:24 UTC
(In reply to Xisco Faulí from comment #12)

Coffee! /me needs some coffee! Sorry for being that much blind!
Comment 14 NISZ LibreOffice Team 2019-05-28 13:04:58 UTC
I made a few quick tests and the last version I was able to reproduce the bug with was 6.0.7. Later versions I tested (6.1.0.3, 6.1.4, 6.2.3 and the latest master) exported the footnote with a shape perfectly fine. We bibisected the issue, and according to our results the bug was solved by this commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=336d052a8db24ec9d19cec47c54ff76ed35a413c&h=libreoffice-6-1

So, according to the bibisect results, this bug is a duplicate of https://bugs.documentfoundation.org/show_bug.cgi?id=107969

*** This bug has been marked as a duplicate of bug 107969 ***