[Libreoffice-bugs] [Bug 136143] New: Regression Err:448 in Optional arguments

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Aug 26 11:06:59 UTC 2020


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

            Bug ID: 136143
           Summary: Regression Err:448 in Optional arguments
           Product: LibreOffice
           Version: 7.0.0.3 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: jp at ledure.be

Created attachment 164709
  --> https://bugs.documentfoundation.org/attachment.cgi?id=164709&action=edit
Error448.odt with Basic code

When running Main() in next Basic code, containing a cascade of calls with
uninitialized optional arguments, the behaviour is different between LO 6.4.5
and LO 7.0.0

Sub Main
Dim a
        a = 1
        SubA(a)
End Sub

Sub SubA(a, Optional x, Optional y)
        SubB(a, x, y)
End Sub

Sub SubB(a, Optional x, Optional y)
        If IsMissing(x) Then x = 2
        MsgBox x
End Sub

In 6.4, the execution ends with the message box containing "2", as expected.

In 7.0 however, the execution aborts on the statement "x = 2" with the error
message
"Inadmissible value or data type. Data type mismatch."

The reason, AFAIK, seems to be that variable x in SubB is of type
- Variant/Error in LO6.4
- Error in LO 7.0
the latter preventing a reset of x to another value.

To reproduce the issue:
----------------------
- open the attached Error448.odt file
- open the Basic IDE
- in the Basic module of the file "Module1", run Main()

Result in 7.0:
-------------
Error "Inadmissible value or data type. Data type mismatch."

Expected result:
---------------
No error message


PS: current bug is the root cause of
https://bugs.documentfoundation.org/show_bug.cgi?id=136063

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200826/7e609f31/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list