diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-08 14:45:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-08 14:48:25 +0200 |
commit | b5594f06c47c38afcb1ac160fd8796d7ca180be5 (patch) | |
tree | 4c88a0750cb6b2f10baaf6b38f5402882369f285 | |
parent | 2e11bbd288ec59d0ff3368cc5c5ef83e2f5133a2 (diff) |
Cater for UNO (signed) vs. BASIC (unsigned) byte mismatch
See <https://listarchives.libreoffice.org/global/users/msg51243.html>
"[libreoffice-users] type byte in Basic", where
> Sub Main
> dim oOutputStream as variant
> oOutputStream = createUnoService("com.sun.star.io.SequenceOutputStream")
> dim nA as byte
> nA = 195
> oOutputStream.writeBytes(array(nA))
> oOutputStream.flush
> dim back(0) as byte
> back = oOutputStream.getWrittenBytes
> MsgBox(back(0))
> End Sub
failed with "Inadmissible value or data type. Overflow." instead of showing
"-61".
Change-Id: I0445476c67510d5f8669a6e711e92332c01ec06c
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index dc1ba44bd3e5..0bd472e61394 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -1429,7 +1429,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper bOverflow = true; nVal = -128; } - else if( nVal > 127 ) + else if( nVal > 255 ) // 128..255 map to -128..-1 { bOverflow = true; nVal = 127; |