Issue 100796

Summary: changes in the css.drawing.ColorTable are not saved
Product: App Dev Reporter: Ariel Constenla-Haile <arielch>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, rb.henschel
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: 4.1.0
Developer Difficulty: ---

Description Ariel Constenla-Haile 2009-04-02 17:56:42 UTC
The changes in the color palette do *not* persist after the UNO object 
dies.

Try the following:

Sub Main
        Dim oColorTable as Object
        oColorTable = CreateUnoService("com.sun.star.drawing.ColorTable")
        
        Dim sNewName$, bHas as Boolean
        sNewName = "My New Color"
        
        If NOT oColorTable.hasByName(sNewName) Then
                oColorTable.insertByName(sNewName, RGB(0,124,197))
                bHas = oColorTable.hasByName(sNewName)
        End If
End Sub

The first time you run the macro, the condition evaluates to false, so you 
insert a new color and bHas returns true, saying this went OK.
The second time you run the macro, the condition should evaluate to true, as 
you already inserted a new color with that name; but this is not the case, 
changes are not made persistent.

This is because the implementation of SvxUnoColorTable 

http://svn.services.openoffice.org/opengrok/xref/DEV300_m42/svx/source/unodraw/unoctabl.cxx

misses the point that changes to the XColorTable must be saved for them to 
really take place... well, at least this is what the color tab page does 
invoking XColorTable::Save().

http://svn.services.openoffice.org/opengrok/xref/DEV300_m42/svx/source/dialog/tpcolor.cxx#757
http://svn.services.openoffice.org/opengrok/xref/DEV300_m42/svx/source/dialog/tpcolor.cxx#915
Comment 1 jsc 2009-04-03 07:05:31 UTC
jsc: depending on i100795
Comment 2 clippka 2009-06-02 14:42:00 UTC
The problem is not in SvxUnoColorTable but in the fact that the current drawing
layer has no color managment and colors that are not used are not kept
persistent. This will be taken into account as soon as we implement a proper
color managment for all applications.