The Calc application that I created uses various colours in the sheets to colour cells as well as charts. I am using HEX codes for the colour values. All colours map to the HTML colour palette in LibreOfice.
One of the colour is Lime (HEX FF00, dec 65280). When the app runs the Lime has become Yellow (HEX FFFF00). It seems that the system is acting like an integer value (2 bytes) not a long (4 bytes). There us no unsigned long, so I cannot force it to ignore the sign bit.
I did some testing with various values. Attached is a macro that shows that a large block of HEX values are not correctly converted to DEC values.
'=================================================
Sub HEXValuesError
dim loGood as long
dim loBad as long
dim hiBad as long
dim hiGood as long
dim RGBLime as long
loGood = &H7FFF
loBad = &H8000
hiBad = &HFFFF
hiGood = &H10000
RGBLime = &HFF00
Dim oService As Object
'This runs the Calc HEX2DEC function
'It shows the correct values
Set oService = CreateUnoService(“com.sun.star.sheet.FunctionAccess”)
msgbox oService.callFunction(“HEX2DEC”, Array(“7FFF”))
msgbox oService.callFunction(“HEX2DEC”, Array(“8000”))
msgbox oService.callFunction(“HEX2DEC”, Array(“FFFF”))
msgbox oService.callFunction(“HEX2DEC”, Array(“10000”))
msgbox oService.callFunction(“HEX2DEC”, Array(“FF00”)) '65280 Green
'This shows the block of values that do not translate (32768 - 65535 inclusive)
msgbox "logood " & logood '* 32767
msgbox "loBad " & loBad '* -32768 (32768)
msgbox "hiBad " & hiBad '* -1 (65535)
msgbox "hiGood " & hiGood '* 65536
msgbox "RGBLime " & RGBLime '* -256 Yellow
End Sub
'===================================================
I would love to be proven wrong in this. Perhaps some setting that will correct this, or just something weird about my setup.
If it is a problem, how do I pass it on?
Any feedback would be appreciated
Thank you
John