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

          Priority: medium
            Bug ID: 62323
          Assignee: [email protected]
           Summary: BASIC macro fails when converting a Hex string that is
                    negative. LibreOffice V4.0.1.2 ( Linux  64-bit / AMD
                    release)
          Severity: major
    Classification: Unclassified
                OS: Linux (All)
          Reporter: [email protected]
          Hardware: x86-64 (AMD64)
            Status: UNCONFIRMED
           Version: 4.0.1.2 release
         Component: BASIC
           Product: LibreOffice

Problem Statement: When using the LibreOffice V4.0.1.2 Linux 64-bit/AMD
release, the execution of the BASIC macro stream will fail upon the instruction
to convert Hex strings of a negative value to a long decimal value.

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

BASIC code that demonstrates the problem:

Sub Example_Code_For_Long()
  dim lngDecimal as long

  ' Testing Positive Hex string converted to long integer - OK:
  lngDecimal = Clng(&H0)
  msgbox "Clng(&H0):     " & Cstr(lngDecimal) 
  'should be: 0 - OK

  lngDecimal = Clng(&H7FFFFFFF)
  msgbox "Clng(&H7FFFFFFF): " & Cstr(lngDecimal) 
  'should be: 2147483647 - OK

  '=====

  ' Testing Negative Hex string converted to long integer.
  ' Fails with Linux 64-bit/AMD LibreOffice 4.0.1.2 

  lngDecimal = Clng(&HFFFFFFFF)
  msgbox "Clng(&HFFFFFFFF): " & Cstr(lngDecimal) 
  'should be: -1 - Fails with Overflow error

  lngDecimal = Clng(&H80000000)
  msgbox "Clng(CH80000000): " & Cstr(lngDecimal) 
  'should be: -2147483648 - Fails with Overflow error

end sub


Note1: The above code run's OK 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

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

Regards, ian.

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

Reply via email to