Bug 106431 - Colors are stored by name which is not a clear identification
Summary: Colors are stored by name which is not a clear identification
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: Color-Palettes
  Show dependency treegraph
 
Reported: 2017-03-08 08:44 UTC by Heiko Tietze
Modified: 2017-04-24 10:00 UTC (History)
3 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 Heiko Tietze 2017-03-08 08:44:08 UTC
When a color is defined in palette A and B with the same name (e.g. Red1) but different hex values (#FF0000 vs. #BF2310) and palette A removed later from the system, this color is falsely applied from B to existing documents. The better solution is to store the hex value and either look for proper names, or to store both information.

Unfortunately ODF references color by the name, e.g. <ref name="color"/>. So the question is if it's feasible.
Comment 1 Regina Henschel 2017-03-08 23:45:37 UTC
(In reply to Heiko Tietze from comment #0)
> Unfortunately ODF references color by the name, e.g. <ref name="color"/>. So
> the question is if it's feasible.

I think, that you are wrong here. The part <ref name="color"/> in the schema is a reference to the part <define name="color"> in the schema. That is line#18014-18018
<define name="color">
    <data type="string">
	<param name="pattern">#[0-9a-fA-F]{6}</param>
    </data>
</define>

You read the same in section 18.3.9 in part 1 of the spec.

In no place in the document the name of a color is stored. And only the path to the last used palette is stored in settings.xml. Another consumer need not read settings.xml at all.
Comment 2 Heiko Tietze 2017-03-09 10:25:26 UTC
(In reply to Regina Henschel from comment #1)
> I think, that you are wrong here. 

Double-checked the issue by creating a new User color "Blue" that is rather green, deleted this color, and reloaded the document. It is stored as hex value

<style:paragraph-properties fo:background-color="#729f00"...

So this issue is indeed NOTABUG, at least for Writer. I'm setting the issue as NEEDINFO and ask the commenter on https://design.blog.documentfoundation.org/2016/12/30/new-color-palettes-in-libreoffice/#comments to submit an example.
Comment 3 Yousuf Philips (jay) (retired) 2017-04-24 10:00:15 UTC
I think you read his comment incorrectly. He said that if he used to use Green 1 in the past palette and used Green 1 in the new palette they would be different colors, well of course. He said he couldnt reuse the old color, but he can will the document colors palette.