Bug 112365 - ODF: LO writes invalid value 0 for attribute draw:gradient-step-count in case of automatic
Summary: ODF: LO writes invalid value 0 for attribute draw:gradient-step-count in case...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-13 07:52 UTC by Regina Henschel
Modified: 2017-10-17 08:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example with "automatic" and with step count = 3 (13.45 KB, application/vnd.oasis.opendocument.text)
2017-09-13 07:52 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2017-09-13 07:52:16 UTC
Created attachment 136219 [details]
Example with "automatic" and with step count = 3

In the step-count is set to "Automatic" LibreOffice writes the value 0 for attribute draw:gradient-step-count. See http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#property-draw_gradient-step-count

"By default, the step count is automatically calculated based on the size and resolution of the filled area.
A gradient step count of color interpretation shall be 3 or greater."

LibreOffice uses the value 0 internally to track the case "Automatic". But it must not write it to file. In case "Automatic" LibreOffice must not write the attribute at all, so that the default case of the spec applies.

[I thought that I had reported already, but I do not find it.]
Comment 1 Julien Nabet 2017-09-13 08:09:35 UTC
Regina: since you assigned yourself (to fix the bug), let's put this one to ASSIGNED.
If it was an error, don't hesitate to revert the status and reset the assignee.
Comment 2 Regina Henschel 2017-09-16 18:23:47 UTC
A possible patch is in https://gerrit.libreoffice.org/#/c/42254/1
But it might be more appropriate to get a change in the specification. I have started a discussion on the mailing list of the TC. https://lists.oasis-open.org/archives/office/201709/msg00018.html
Comment 3 Regina Henschel 2017-10-17 08:35:27 UTC
The TC has agreed to allow value 0 with the meaning of "default". 
https://issues.oasis-open.org/browse/OFFICE-3934
https://lists.oasis-open.org/archives/office/201710/msg00032.html
Comment 4 Heiko Tietze 2017-10-17 08:59:47 UTC
Many thanks to stay on this task - and finally solve it with zero coding effort :-). Let's close this ticket as NAB.