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

--- Comment #5 from Mike Kaganski <[email protected]> ---
(In reply to Mike Kaganski from comment #4)
> in the mentioned "Choose "smallest"
> representation for int values because up cast is allowed, downcast not"
> hackery, there are uses of cppu::UnoType<sal_uInt8> - i.e., an UNO type for
> *unsigned* 8-bit values.

Oh my. Debugging that, I see that cppu::UnoType<sal_uInt8> corresponds to
TypeClass::BOOLEAN, which is handled as TRUE/FALSE type - the sbxToUnoValue
clamps the value to SbxValue::GetBool().

Which means that commit 11f9aa4fcb2ad0a5fada8561c7041e7f25a059fc broke all the
128..255 unsigned short/long values passed from Basic to UNO to become 1. Fun.
(But I wonder how can we create such types in Basic - which could be the reason
why it goes unnoticed for so long...)

So could we pass the 128+ Byte values in TypeClass::SHORT? Maybe. That would
mean that *if* the UNO expects a byte, and gets such a short, it will throw an
error (see that "up cast is allowed, downcast not")...

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

Reply via email to