Bug 103478 - FILESAVE: PPTX - Shape fill color lost after roundtrip due to theme xml file
Summary: FILESAVE: PPTX - Shape fill color lost after roundtrip due to theme xml file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:pptx, regression
Depends on:
Blocks: OOXML-Object-Fill PPTX OOXML-Doc-Themes
  Show dependency treegraph
 
Reported: 2016-10-24 19:04 UTC by Xisco Faulí
Modified: 2019-05-20 05:32 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
compare filesave MSO 2010 and LO 5.3+.jpg (55.14 KB, image/jpeg)
2016-10-25 13:02 UTC, Timur
Details
compare fileopen MSO 2010 and LO 5.3+.jpg (55.34 KB, image/jpeg)
2016-10-25 13:02 UTC, Timur
Details
sample (397.08 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2017-05-23 11:24 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2016-10-24 19:04:03 UTC
Steps:
1. Open attachment #128207 [details]
2. Save it as .PPTX
3. Open the new file

Observed behavior: red background color in numbers is lost

Reproduced in 

Version: 5.3.0.0.alpha0+
Build ID: 8974b0fafb18f9dd3f2c0e175a3255b80e4c249e
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

but not in 

Version: 4.2.0.0.alpha1+
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3

thus, it's a regression
Comment 1 Yousuf Philips (jay) (retired) 2016-10-24 19:43:07 UTC
Confirmed it is a filesave issue with opening the file also in powerpoint, though LO 4.2.8.2 saved it correctly and 4.3.7.2 didnt.

Version: 5.3.0.0.alpha1+
Build ID: 928776b734c6aa188151bbce048d5bef4486dce7
CPU Threads: 2; OS Version: Linux 3.19; UI Render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-10-23_00:39:08
Locale: en-US (en_US.UTF-8); Calc: group
Comment 3 Xisco Faulí 2016-10-24 20:17:26 UTC
Among the commits in the range, there're two that look quite suspicious to me:

author	Jacobo Aragunde Pérez <jaragunde@igalia.com>	2014-01-14 17:43:06 (GMT)
committer	Jacobo Aragunde Pérez <jaragunde@igalia.com>	2014-01-18 13:51:42 (GMT)
commit 15e01d90b92a84cba538940614ea30df401a9976 (patch)
tree 978b6d6802af74a558d17264596d54cc78e46a01
parent 2e34ceeb92b6d61a2bd7a1ac1e2828fbf7c9f176 (diff)

ooxml: Preserve shape style attribute fillRef

and 

author	Jacobo Aragunde Pérez <jaragunde@igalia.com>	2014-01-16 09:27:46 (GMT)
committer	Jacobo Aragunde Pérez <jaragunde@igalia.com>	2014-01-18 13:51:43 (GMT)
commit bc0a9076aa43a0782bcf81e55d3f84f6af0f68e8 (patch)
tree 909a71cd59e868368d6e6ae8277823aee75b2685
parent 15e01d90b92a84cba538940614ea30df401a9976 (diff)

ooxml: Preserve shape theme attribute for solid fill

Adding Cc: to Jacobo Aragunde Pérez
Comment 4 Timur 2016-10-25 12:58:04 UTC
I guess this may be the same as in 1-slide PPTX attachment 128239 [details] that's supposed to look like PDF attachment 128240 [details] from Bug 103488 (I reported that from attachment 114355 [details] from Bug 90237).
There, after roundtrip, the red background colour (Dark Red, Accent 2) is greyed and the red bar line colour (Red, Accent 1) is changed from red to blue. 
I add "in shape" in the title. Those are solid colors.
Comment 5 Timur 2016-10-25 13:02:27 UTC
Created attachment 128247 [details]
compare filesave MSO 2010 and LO 5.3+.jpg
Comment 6 Timur 2016-10-25 13:02:46 UTC
Created attachment 128248 [details]
compare fileopen MSO 2010 and LO 5.3+.jpg
Comment 7 Jacobo Aragunde Pérez 2016-10-25 15:28:57 UTC
The cause of the bug is the same as the following one:

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

OOXML documents may contain a theme file that specifies a list of preset styles, colors, etc. Changing the theme in MSO would change the format for any objects that are related to it.

The purpose of the set of commits that bc0a9076aa4 belongs is to preserve the assignment of theme colors. Previously to that commit, theme colors were converted to plain colors by LO on save, so when the document was opened back in MSO it remained unaffected by theme changes.

Unfortunately, the theme file (which is an XML file that is part of the OOXML document) is lost in the save process of XLSX or PPTX files. It only survives in the case of DOCX. That's why colors are lost, the shape refers to a theme color and the theme file doesn't exist.

The proper way to fix this bug is making sure the theme file is preserved on save. It should be detected on open, stored somewhere and written back to the file on save.
Comment 8 Xisco Faulí 2017-05-23 11:24:10 UTC
Created attachment 133475 [details]
sample

Shapes' colours in the document change from red to blue after roundtrip to .pptx
Comment 9 Kevin Suo 2017-11-07 03:32:24 UTC
The bug disappears in

Version: 6.0.0.0.alpha1+
Build ID: 2416d69ad4fa26b65d5b05a8575ac96af6b2c9a9
CPU threads: 2; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: zh-CN (zh_CN.UTF-8); Calc: group

It's most likely been fixed by the following commit:
author	Szymon Kłos <szymon.klos@collabora.com>	2017-10-17 20:14:38 (GMT)
committer Szymon Kłos <szymon.klos@collabora.com> 2017-10-31 12:52:34 (GMT)
commit c344d74a6961ec39685d718fbb7c29dd186ca0a4
PPTX export: remember color schemes in theme
Remember color scheme from loaded pptx file
or use default values.

Mark as RESOLVED FIXED.
Comment 10 Xisco Faulí 2017-11-07 14:31:18 UTC
Verified in

Version: 6.0.0.0.alpha1+
Build ID: 38a8157d9447134913d88c6c373d99a7aa472857
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group