From b5594f06c47c38afcb1ac160fd8796d7ca180be5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 8 Jun 2017 14:45:05 +0200 Subject: Cater for UNO (signed) vs. BASIC (unsigned) byte mismatch See "[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 --- basic/source/classes/sbunoobj.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3