Bug 99908 - Custom Gradient not getting saved to ODP
Summary: Custom Gradient not getting saved to ODP
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Katarina Behrens (CIB)
URL:
Whiteboard: target:5.4.0 target:5.3.2
Keywords:
: 105839 106570 (view as bug list)
Depends on:
Blocks: Sidebar-Properties-Slide Object-Fill Sidebar-Properties
  Show dependency treegraph
 
Reported: 2016-05-17 13:15 UTC by Susobhan Ghosh
Modified: 2017-05-03 10:58 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susobhan Ghosh 2016-05-17 13:15:05 UTC
Steps to reproduce -

1) Open Slide Background Panel in Sidebar.

2) Choose Gradient as the Background.

3) Choose any two colors from the dropdowns below.

4) Save the file.

5) Close the file, and re-open.

The Gradient becomes black and white upon reopening. I compared the styles.xml in the ODP file when I used a custom gradient vs preset gradient in slide background dialog (Slide->Slide Properties->Background->Gradient) - When two custom colors are used to define a gradient (as in the description above), the configuration line for it is totally missing, while it is present for a preset gradient.
Comment 1 Katarina Behrens (CIB) 2016-05-17 13:47:17 UTC
This is very much confirmed
Comment 2 Yousuf Philips (jay) (retired) 2016-08-23 10:12:34 UTC
So looking at the xml of a document saved with a custom gradient from the sidebar, there were two problems in the saved document.

1) styles.xml: it isnt saving the custom gradient in a <draw:gradient> tag under <office:styles>

2) content.xml: it is having a blank draw:fill-gradient-name attribute in the <style:drawing-page-properties> tag under <style:style> under <office:automatic-styles>

Possible solutions:

1) when background is set to gradient in the sidebar, create a random named file-level preset for it

2) during the export process, if a gradient doesnt have name, create a random name for it

Looking at the ODF output from the code done by Rishabh for the custom gradient in the sidebar area fill content panel, it uses solution 1.
Comment 3 Eric 2016-09-13 06:06:53 UTC
This bug still exists in 5.2.0.4 (release) too (debian sarge).
Comment 4 Eric 2016-09-13 06:11:36 UTC
(In reply to Eric from comment #3)
> (debian sarge).
sorry. "Stretch" of course
Comment 5 Commit Notification 2017-02-13 09:01:53 UTC
Katarina Behrens committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=529162307e9d6191fe43d50597504474b2c1a5ba

tdf#99908: Ensure non-empty unique gradient names

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Katarina Behrens (CIB) 2017-02-13 09:32:46 UTC
So the above patch fixes FILESAVE issue, but not FILEOPEN one, i.e. doesn't fix the documents that have been broken already (and contain nameless page gradients). 

I'm lazy and closing this as fixed, since the workaround is trivial (simply change the gradient to the desired one and re-save the file)
Comment 7 Xisco Faulí 2017-02-14 09:23:22 UTC
*** Bug 105839 has been marked as a duplicate of this bug. ***
Comment 8 Katarina Behrens (CIB) 2017-02-14 11:42:47 UTC
Presumably some people would be happy if this fix got into 5.3, right?
Comment 9 Commit Notification 2017-02-23 19:25:47 UTC
Katarina Behrens committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e28fd26d69553733778a86c84cd74e284a079e15&h=libreoffice-5-3

tdf#99908: Ensure non-empty unique gradient names

It will be available in 5.3.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Xisco Faulí 2017-03-17 10:45:19 UTC
*** Bug 106570 has been marked as a duplicate of this bug. ***
Comment 11 Thomas Lendo 2017-05-03 10:58:07 UTC
Looks good in 5.3.2.2 on Windows 6.2.
Just for the sake of completeness.