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

            Bug ID: 102381
           Summary: A user function called from a Clac formula wrongly
                    gets passed numeric 0 for missing optional parameters
                    between used positions.
           Product: LibreOffice
           Version: 3.3.0 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 127568
  --> https://bugs.documentfoundation.org/attachment.cgi?id=127568&action=edit
Demo mentioned in the OP

A function programmed in BASIC for use in Calc may have parameters declared
optional. Positions of optional parameter may occur anywhere in the formal
parameter list. 
Calls to the function with omitted parameters from a BASIC Sub yield the
expected results.

Calls from a formula evaluated for a Calc cell wrongly pass the numeric 0 for
omitted optional parameters. 

I only stumbled over the bug recently, but this in a case where I tried to get
a function actually usable "in production". I could not find a promising
workaround. The severity is therefore higher than normal from my point of view. 

For trailing omitted optional parameters an error Err:511 is thrown by LibO
V3.3 Calc if parameter separators are used. No separator, nothing passed. (This
also is the behaviour of AOO up to 4.1.2.)

V3.5 and higher accept trailing omitted, even if there is a surplus in
positions.
they then also pass a 0 for declared but omitted parameters and nothing for
parameter positions in surplus.

See attached demo.

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

Reply via email to