https://bugs.documentfoundation.org/show_bug.cgi?id=149447

            Bug ID: 149447
           Summary: DEC2HEX called vie a FuinctionAccess service is
                    accepting type Byte, but treats it as if it is
                    ShortInt (-128..127).
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

The subject says it all.

To reproduce the issue run the following code stzepwise. 

Sub dings
Dim fa As Object, byH1 As String, byH2 As String, byDbl As Double
Dim by As Byte, by2 As Byte, zero As Long
fa   = CreateUnoService("com.sun.star.sheet.FunctionAccess")
by   = 255 REM or something in 128<= something <= 255
byH1 = fa.callFunction("DEC2HEX", Array(by       , 4))
byH2 = fa.callFunction("DEC2HEX", Array(by + zero, 4))
REM Not a good idea to treat type Byte as if it is ShortInt -128..127.
REM Bad idea to do it in an inconsistent way. 
byDbl = CDbl(by)
by2  = by + 1
End Sub

Well, DEC2HEX iks made for Calc, and there is no type Short (ShortInt), but if
it applies conversion, it should do it consistently via Double.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to