https://bugs.documentfoundation.org/show_bug.cgi?id=148645
Bug ID: 148645
Summary: com.sun.star.sheet.addin.Analysis.getDec2Hex does not
take integer 'places' value
Product: LibreOffice
Version: unspecified
Hardware: All
URL: https://ask.libreoffice.org/t/need-for-xpropertyset-ob
ject-when-calling-getdec2hex/76567
OS: All
Status: UNCONFIRMED
Keywords: difficultyBeginner, easyHack, skillCpp
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Consider this code:
sub TestDec2Hex
oService = createUNOService("com.sun.star.sheet.addin.Analysis")
MsgBox oService.getDec2Hex(Nothing, 1234, Empty)
MsgBox oService.getDec2Hex(Nothing, 1234, "")
MsgBox oService.getDec2Hex(Nothing, 1234, "8")
MsgBox oService.getDec2Hex(Nothing, 1234, 8.1)
MsgBox oService.getDec2Hex(Nothing, 1234, 8.0)
MsgBox oService.getDec2Hex(Nothing, 1234, 8)
end sub
All the calls to getDec2Hex will succeed, *except for the last two*, where
'8.0' and '8' are passed as the last 'places' argument. So, the most natural
way of using the function is unavailable.
Code pointer:
The function is implemented in scaddins/source/analysis/analysis.cxx. It uses
ScaAnyConverter::getInt32 to handle the uno::Any value of the places argument.
The task is to change the code that extracts the value, to allow not only empty
values, strings and doubles, but also other numerical types, as the argument
value.
The easy hack should include a unit test.
--
You are receiving this mail because:
You are the assignee for the bug.