https://bugs.freedesktop.org/show_bug.cgi?id=62326

          Priority: medium
            Bug ID: 62326
          Assignee: libreoffice-bugs@lists.freedesktop.org
           Summary: Instruction Cint fails when converting Hex strings of
                    a negative value to a 16-bit integer value.
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: irsb...@hotmail.com
          Hardware: All
            Status: UNCONFIRMED
           Version: 4.0.1.2 release
         Component: BASIC
           Product: LibreOffice

Problem Statement: LibreOffice execution of a BASIC macro stream will fail upon
the instruction Cint when converting Hex strings of a negative value to a
16-bit integer value.

Program execution is halted and the error message displayed is: “Inadmissible
value or data type. Overflow”.

If the same BASIC code is run on Visual Basic V6.0 or the Visual Basic V6.5
included with MS Office 2003, then it executes without errors.

BASIC code that demonstrates the problem:

Sub Example_Code_For_Integer()
  dim intDecimal as integer

  ' Testing Positive Hex string converted to 16-bit integer - OK
  intDecimal = Cint(&H0)
  msgbox "Cint(&H0): " & Cstr(intDecimal) 
  'should be: 0 - OK

  intDecimal = cint(&H7FFF)
  msgbox "Cint(&H7FFF): " & Cstr(intDecimal) 
  'should be: 32767 - OK

  '=====

  ' Testing Negative Hex string converted to 16-bit integer - Fails 

  intDecimal = Cint(&HFFFF)
  msgbox "Cint(&HFFFF): " & Cstr(intDecimal) 
  'should be: -1 - Fails with Overflow error

  intDecimal = Cint(&H8000)
  msgbox "Cint(&H8000): " & Cstr(intDecimal) 
  'should be: -32768 - Fails with Overflow error

end sub

Note1: The above code was found to fail on the following LibreOffice platforms: 
LibreOffice 4.0.1.2 on WindowsXP SP3
LibreOffice 3.6.2.2 on Ubuntu 12.10 (quantal) 32-bit Linux 3.5.0-21
OpenOffice 3.2.1 on Ubuntu 10.10 (maverick) 32 bit Linux 2.6.35-22 
LibreOffice 3.3.3 Ubuntu 11.04 (natty) 32-bit Linux 2.6.38-11-generic 
LibreOffice 4.0.1.2 on Debian 6.0.7 (squeeze) 64-bit Linux 2.6.32-5-amd64.

Note2: I don't have a Mac to test whether or not this problem exists on the Mac
/ LibreOffice platform.

Note3: I have posted Bug 62323. It is similar to this bug, however it is
specific to the LibreOffice Linux 64-bit/AMD release and occurs using when the
Clng instruction. 

Regards, ian.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to