"CharBackColor" property of XPropertySet in Java
Posted: Thu Sep 17, 2015 5:58 pm
I have encountered a strange problem in a plugin I have written in Java using the OpenOffice Netbeans plugin.
I am finding that the "CharColor" property and the "CharBackColor" property are behaving differently.
I can set text color by getting the integer value of the color from a Java Color object without any problem:
This correctly sets the text to Blue, and the Color object in Java automatically sets the alpha to 100% (0xFF).
However this does not work for the "CharBackColor" property:
The above code should set the background color of the text to Yellow, instead there is no visible effect.
If however I explicitly set the alpha to 0 (which should make it transparent), now you can see a Yellow background!
This certainly is not behaving correctly. The only way to set the background color is to explicitly set the alpha to transparent by subtracting the alpha bits!
This only happens for the "CharBackColor" property, and not for the "CharColor" property.
I have not tested this in any other languages, only in Java using the Netbeans plugin.
If anyone else can run a test based on this exact use case, please confirm the results.
I have also opened an issue for this on the bugzilla bug tracker. If anyone can confirm the results from this same test, please confirm on the bug tracker also: https://bz.apache.org/ooo/show_bug.cgi?id=126531
I am finding that the "CharColor" property and the "CharBackColor" property are behaving differently.
I can set text color by getting the integer value of the color from a Java Color object without any problem:
Code: Select all
xPropertySet.setPropertyValue("CharColor", Color.BLUE.getRGB()); //same as hex 0xFF0000FF
However this does not work for the "CharBackColor" property:
Code: Select all
xPropertySet.setPropertyValue("CharBackColor", Color.YELLOW.getRGB()); //same as hex 0xFFFFFF00
If however I explicitly set the alpha to 0 (which should make it transparent), now you can see a Yellow background!
Code: Select all
xPropertySet.setPropertyValue("CharBackColor", Color.YELLOW.getRGB() - 0xFF000000); //same as hex 0x00FFFF00
This only happens for the "CharBackColor" property, and not for the "CharColor" property.
I have not tested this in any other languages, only in Java using the Netbeans plugin.
If anyone else can run a test based on this exact use case, please confirm the results.
I have also opened an issue for this on the bugzilla bug tracker. If anyone can confirm the results from this same test, please confirm on the bug tracker also: https://bz.apache.org/ooo/show_bug.cgi?id=126531