https://bugs.documentfoundation.org/show_bug.cgi?id=165219
Bug ID: 165219
Summary: Basic interpreter doesn’t accept Variant function
parameters if they may be used as Object
Product: LibreOffice
Version: 24.2.5.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Created attachment 199168
--> https://bugs.documentfoundation.org/attachment.cgi?id=199168&action=edit
Macro Main shows the problem
If a function declares a Variant parameter, and if this parameter may be used
as an object somewhere in the function, it is no longer possible to call this
function with a non objet parameter.
For exemple :
Function example(param as Variant)
If IsObject(param) Then : result = param.getURL()
Else : result = "param is not an object"
End If
example() = result
End Function
Calling example(ThisComponent) is OK and returns the document URL
But calling example("a string") generate an error "undefined parameter"
The error doesn't appear if param is not used as an objet. For instance by
copying it to a local variable, replacing
result = param.getURL()
by
obj = param: result = obj.getURL()
--
You are receiving this mail because:
You are the assignee for the bug.