Bug 118237 - FILESAVE DOCX w:themeColor and w:themeShade attributes get duplicated inside w:color tag
Summary: FILESAVE DOCX w:themeColor and w:themeShade attributes get duplicated inside ...
Status: RESOLVED DUPLICATE of bug 123705
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: dataLoss, filter:docx
: 120428 (view as bug list)
Depends on:
Blocks: DOCX-SAXParse
  Show dependency treegraph
 
Reported: 2018-06-19 07:09 UTC by Gabor Kelemen (allotropia)
Modified: 2019-05-07 09:20 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Example file from Word 2013 with w:themeShade attribute (34.13 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 07:09 UTC, Gabor Kelemen (allotropia)
Details
First example file saved from current LO 6.2master (22.99 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 07:10 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the error message (8.17 KB, image/png)
2018-06-19 07:12 UTC, Gabor Kelemen (allotropia)
Details
Second example file from Word, with w:themeColor attribute (30.93 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 07:13 UTC, Gabor Kelemen (allotropia)
Details
Second example file saved from current LO 6.2 master (23.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 07:13 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the second files error message (8.15 KB, image/png)
2018-06-19 07:16 UTC, Gabor Kelemen (allotropia)
Details
Third example file from Word with w:themeColor tag (32.71 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 07:18 UTC, Gabor Kelemen (allotropia)
Details
Third example file saved by current LO 6.2 master (21.35 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-19 07:19 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the third files error message (13.29 KB, image/png)
2018-06-19 07:20 UTC, Gabor Kelemen (allotropia)
Details
The first example file exported with current master build (17.93 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-08 08:28 UTC, Gabor Kelemen (allotropia)
Details
The second example file exported with current master build (16.37 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-08 08:29 UTC, Gabor Kelemen (allotropia)
Details
The third example file exported with current master build (18.16 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-08 08:31 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-06-19 07:09:34 UTC
Created attachment 142895 [details]
Example file from Word 2013 with w:themeShade attribute

The attached three documents were created in Microsoft Office, and have a similar issue: the w:themeColor or the w:themeShade attributes inside a w:color tag gets duplicated, resulting a broken file. All three documents were made with track changes turned on, and had tracked changes near or around the broken tags. All documents were originally more complex, the attached files are simplified and focused on the bug. As the documents weren't made by us, we don't know exactly, how the bug can be reproduced. We uploaded three documents with similar issue to help in identifying the underlying bug causing the issue.

These are the broken tags for each document:
SAXParseException-themecolor-LO62Dev.docx:
<w:color w:val="000000" w:themeColor="text1" w:themeColor="text1"/>

SAXParseException-themecolor-2-LO62Dev.docx:
<w:color w:val="000000" w:themeColor="text1" w:themeColor="text1"/>

SAXParseException-wthemeshade-LO62Dev.docx
<w:color w:val="365F91" w:themeColor="accent1" w:themeShade="bf" w:themeColor="accent1" w:themeShade="bf"/>

Steps to reproduce:
1. Open a file ending with -MSO (SAXParseException-themecolor-MSO.docx, SAXParseException-themecolor-2-MSO.docx or SAXParseException-wthemeshade-LO62Dev.docx)
2. Save the file as DOCX with LibreOffice Writer.
3. Reopen the saved file in LibreOffice Writer or Microsoft Word.

Actual results:
An attribute inside a w:color tag gets duplicated, resulting the file to open with an “SAXParseException: '[word/document.xml line 2]” error message.

Expected results:
Attributes inside w:color tags shouldn't duplicate.
Comment 1 Gabor Kelemen (allotropia) 2018-06-19 07:10:16 UTC
Created attachment 142896 [details]
First example file saved from current LO 6.2master
Comment 2 Gabor Kelemen (allotropia) 2018-06-19 07:12:05 UTC
Created attachment 142897 [details]
Screenshot of the error message
Comment 3 Gabor Kelemen (allotropia) 2018-06-19 07:13:05 UTC
Created attachment 142898 [details]
Second example file from Word, with w:themeColor attribute
Comment 4 Gabor Kelemen (allotropia) 2018-06-19 07:13:37 UTC
Created attachment 142899 [details]
Second example file saved from current LO 6.2 master
Comment 5 Gabor Kelemen (allotropia) 2018-06-19 07:16:46 UTC
Created attachment 142900 [details]
Screenshot of the second files error message
Comment 6 Gabor Kelemen (allotropia) 2018-06-19 07:18:41 UTC
Created attachment 142901 [details]
Third example file from Word with w:themeColor tag
Comment 7 Gabor Kelemen (allotropia) 2018-06-19 07:19:27 UTC
Created attachment 142902 [details]
Third example file saved by current LO 6.2 master
Comment 8 Gabor Kelemen (allotropia) 2018-06-19 07:20:00 UTC
Created attachment 142903 [details]
Screenshot of the third files error message
Comment 9 Buovjaga 2018-06-24 18:25:10 UTC
Already in 5.0.2 (tested on Win). 4.4.7 eats most of the table. 4.3.0 looks kind of ok, but I'm not sure if there is some underlying feature that became supported after this point

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 5b42a17dc99fba2ccf8dd8d0a8e0e4e836e30120
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on June 22nd 2018
Comment 10 Mike Kaganski 2018-06-25 06:56:26 UTC
The problematic part is in MSWordExportBase::OutputTextNode. First, it takes pRedlineData from SwWW8AttrIter (which extra data has a grab bag with the properties); then it calls SwWW8AttrIter::OutAttr(), which also finds the same grab bag, and outputs it; and then (back in MSWordExportBase::OutputTextNode) 
AttrOutput().EndRunProperties is called, which *may* output the redline with the grab bag (creating the duplication). RtfAttributeOutput::EndRunProperties doesn't output the redline data; so I'm not sure what to do here.

Michael: could you please take a look if you have any idea here?
Comment 11 J22Gim 2018-10-09 14:40:43 UTC
I had similar problem, related to track changes. 
If I accept the changes, the problem is gone.

See it here: https://bugs.documentfoundation.org/show_bug.cgi?id=120428
Comment 12 Timur 2018-10-09 14:51:12 UTC
*** Bug 120428 has been marked as a duplicate of this bug. ***
Comment 13 Timur 2018-10-09 14:54:03 UTC
Bug 120428 has example attachment 145531 [details] with preview  attachment 145526 [details].
Comment 14 Gabor Kelemen (allotropia) 2019-03-08 08:28:27 UTC
Created attachment 149811 [details]
The first example file exported with current master build

With current master build from bbc5347be70d11d187cd537dd73cdab584def719 the problem is no longer present.
Comment 15 Gabor Kelemen (allotropia) 2019-03-08 08:29:01 UTC
Created attachment 149812 [details]
The second example file exported with current master build

This works fine too.
Comment 16 Gabor Kelemen (allotropia) 2019-03-08 08:31:06 UTC
Created attachment 149813 [details]
The third example file exported with current master build

The third files export opens fine too.
Comment 17 Gabor Kelemen (allotropia) 2019-03-08 08:31:39 UTC

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