Bug 123705 - After save a DOCX file, it gives a error when it try to be open (avoid duplicate themeColor)
Summary: After save a DOCX file, it gives a error when it try to be open (avoid duplic...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: All All
: medium critical
Assignee: Julien Nabet
URL:
Whiteboard: target:6.3.0 target:6.2.2 target:6.1.6
Keywords: haveBacktrace
: 118237 125136 (view as bug list)
Depends on:
Blocks: DOCX-Opening
  Show dependency treegraph
 
Reported: 2019-02-25 15:13 UTC by Angel
Modified: 2019-05-07 09:20 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file for bug (48.14 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-02-25 15:15 UTC, Angel
Details
bt with debug symbols (14.28 KB, text/plain)
2019-02-25 21:37 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Angel 2019-02-25 15:13:18 UTC
Description:
Do a small change in the file, save it, close it, and try to reopen. 
It gives you a error message
"SAXException: [word/document.xml line 2]: Attribute w:themeColor redefined"
and if you ask to reopen, the file lost part of the formats

Steps to Reproduce:
1. Open the attached file
2. Do a minor change
3. Save the file
4. Close teh file
5. Open the file
6. You have the error message 

Actual Results:
Part of the File formats are lost

Expected Results:
Part of the formats of the file are lost


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Angel 2019-02-25 15:15:00 UTC
Created attachment 149580 [details]
Test file for bug
Comment 2 Dieter 2019-02-25 16:44:54 UTC
I confirm it with

Version: 6.3.0.0.alpha0+ (x64)
Build ID: f42554a1886ebe49170c25096dc3281b2c7bb1f4
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-02-08_22:37:30
Locale: en-US (de_DE); UI-Language: en-US
Calc: threaded
Comment 3 Julien Nabet 2019-02-25 21:37:22 UTC
Created attachment 149585 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated some days ago + enable-dbgutil, I got an assert after having changed a bit the file and saved it.
Comment 4 Julien Nabet 2019-02-26 15:49:30 UTC
Considering https://opengrok.libreoffice.org/xref/core/sw/source/filter/ww8/docxattributeoutput.cxx?r=167d4a99#2458 which clears:
- m_pFontsAttrList
- m_pEastAsianLayoutAttrList
- m_pCharLangAttrList
but also m_pColorAttrList

I wonder we shouldn't add in sw/source/filter/ww8/docxattributeoutput.cxx#2930 these lines:
rtl::Reference<sax_fastparser::FastAttributeList> pColorAttrList_Original(m_pColorAttrList);
m_pColorAttrList.clear();

then:
m_pColorAttrList = pColorAttrList_Original;

I'll test this tonight.
Comment 5 Julien Nabet 2019-02-26 18:12:30 UTC
Patch on review for master branch:
https://gerrit.libreoffice.org/#/c/68398/
Comment 6 Commit Notification 2019-03-02 07:26:32 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/42398e3860aafd6468688eda6c0da942323b7f82%5E%21

tdf#123705: avoid duplicate themeColor

It will be available in 6.3.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.
Comment 7 Julien Nabet 2019-03-02 07:27:59 UTC
backports waiting for review:
- 6.2: https://gerrit.libreoffice.org/#/c/68613/
- 6.1: https://gerrit.libreoffice.org/#/c/68614/
Comment 8 Commit Notification 2019-03-04 14:07:46 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/7b9e13376423d54cf95dfc48c9d3de0a62826943%5E%21

tdf#123705: avoid duplicate themeColor

It will be available in 6.2.2.

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.
Comment 9 Gabor Kelemen (allotropia) 2019-03-08 08:31:39 UTC
*** Bug 118237 has been marked as a duplicate of this bug. ***
Comment 10 Commit Notification 2019-04-02 07:09:40 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/a1e44657ef62488076b0f4cfd271d0a73cbff7d3%5E%21

tdf#123705: avoid duplicate themeColor

It will be available in 6.1.6.

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.
Comment 11 Timur 2019-05-07 09:11:59 UTC
Repro with LO 5.0, maybe also with 4.4.
Comment 12 Timur 2019-05-07 09:16:12 UTC
*** Bug 125136 has been marked as a duplicate of this bug. ***