We have been using a macro to change the Document Background Color. This macro stopped working with version 25.02.0.3. The problem is with this line: keyNodeColor.setPropertyValue("Color", rgb(R,G,B)) where: keyNode = Tools.Misc.GetRegistryKeyContent("org.openoffice.Office.UI/ColorScheme", False) curScheme = keyNode.CurrentColorScheme ' Get the scheme node nodeName = "org.openoffice.Office.UI/ColorScheme/ColorSchemes/" & curScheme & "/DocColor" ' Set the root path for our configuration access keyNodeColor = Tools.Misc.GetRegistryKeyContent(nodeName, True) This is the error message: BASIC runtime error. An exception occurred Type: com.sun.star.beans.UnknownPropertyException Message: Color. Version: 25.2.0.3 (X86_64) / LibreOffice Community Build ID: e1cf4a87eb02d755bce1a01209907ea5ddc8f069 CPU threads: 4; OS: Windows 11 X86_64 (10.0 build 22000); UI render: Skia/Raster; VCL: win Locale: en-CA (en_CA); UI: en-US Calc: CL threaded I can supply the entire macro if needed, but I think the line with the error and the definitions should suffice.
@Sahil, @Heiko, were there also API changes expected around removal of Application Colors? What would folks need to use now to macro script UI with new Appearance themes. Just a 'customization' name change in the new framework?
@Michael Was purpose of that adjusting the document's style, ie. to change its printed/output page color? Or just its appearance in the UI--responding to os/DE or appearance theme/app colors?
The purpose was to change the background colour of the active cell when entering data. Currently, the colour of the active cell when entering data is set by the Document Background Color. We transcribe historic weather data with the image of the document page as the image background. These images can be quite dark, and it is easier to see our entered text with a yellow font. However, it is hard to see the yellow font when you are entering the data against the white background of the active cell. We get around it by changing the Document Background Color.
Created attachment 199237 [details] Image of the spreadsheet when entering data with a dark active cell background This image shows how we use a yellow font when entering data. The font is very visible against the image, and it is easy to see against the non-white background of the cell when we are entering the data. In an ideal world, the cell background, when entering data, would be transparent so we could see the image while we type. We were told, when asking for that enhancement, that it would be too difficult to implement, so changing the Document Background Color is our option.
(In reply to Michael from comment #0) > nodeName = "org.openoffice.Office.UI/ColorScheme/ColorSchemes/" & curScheme > & "/DocColor" We distinguish between Light and Dark now (see also bug 164970) and you might need to add what is defined on the OS/DE. Or force the appearance to be one.
@Michael does that work for you? can we close the ticket.
That definition of nodename is the exactly the same as what I was using. These are the pertinent lines: nodeName = "org.openoffice.Office.UI/ColorScheme/ColorSchemes/" & curScheme & "/DocColor" ' Set the root path for our configuration access keyNodeColor = Tools.Misc.GetRegistryKeyContent(nodeName, True) And, farther down, this is the line that fails: keyNodeColor.setPropertyValue("Color", rgb(R,G,B)) with this message: BASIC runtime error. An exception occurred Type: com.sun.star.beans.UnknownPropertyException Message: Color. I will attach the full macro.
Created attachment 199312 [details] ChangeDocBgColor macro fails after version 25.02.03 This is the macro that fails. I have commented out the On Local Error line.
(In reply to Michael from comment #8) > Created attachment 199312 [details] > ChangeDocBgColor macro fails after version 25.02.03 > > This is the macro that fails. I have commented out the On Local Error line. for all the lines which set the color property value (like the one below) keyNodeColor.setPropertyValue("Color",Colour(Value)) please replace them with two of these statements one for "Light", and one for "Dark", something like this. keyNodeColor.setPropertyValue("Light",Colour(Value)) keyNodeColor.setPropertyValue("Dark",Colour(Value))
That works, thank you. I'm sorry for being so slow to catch on.