Apache OpenOffice (AOO) Bugzilla – Issue 100796
changes in the css.drawing.ColorTable are not saved
Last modified: 2014-07-02 11:17:50 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
jsc: depending on i100795
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.