Apache OpenOffice (AOO) Bugzilla – Issue 94459
InsertByName from com.sun.star.drawing.ColorTable didn't work
Last modified: 2013-02-24 21:07:10 UTC
InsertByName from com.sun.star.drawing.ColorTable didn't work as expected. I was trying to add a color (insertByName) to the color palette but it doesn't add the color. Is there a workaround ? something else to do ? Here is the source code : Sub addColorPalette() dim serviceColor As Object serviceColor = createUnoService("com.sun.star.drawing.ColorTable") 'Error IllegalArgumentException serviceColor.insertByName("myColor",RGB(100,100,100)) 'Do nothing 'serviceColor.insertByName("myColor","123456") End Sub The second argument is a variant representing the RGB Color. Tested on OOo3 RC3 and OOo 2.4 => Not OK.
jsc -> cl: maybe you see directly what is wrong. At least the service description is missing the IDL reference.
I can confirm that there is a bug in the code for both insertByName and replaceByName. Unfortunately there are no workarounds
fixed in cws impressfontsize for OOo 3.1
Fix looks good. Verified.
fix integrated, closing
Working with OOo 3.1 and SDK 3.1, changes done by insertByName(removeByName) are not persisted into any of files (eg. standard.soc).
I concur : changes are not written in any soc files. Tested with OOo 3.1 and OOo 3.2 (Dev300 m52).
This API is currently not designed to work with the soc files. You can use xml libraries to edit soc files. I agree that there must be an API to work with these files but this has low priority at the moment because a complete color managment update would be done first which would change the handling of soc files altogether. If you still think someone should do an api for soc files now, please open a new issue for this (not this one)