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

--- Comment #2 from Mike Kaganski <[email protected]> ---
(In reply to Mike Kaganski from comment #0)
> The argument may be simply an empty reference (in which case, a default
> locale-independent conversion would be used), so e.g. Basic macros may pass
> 'Nothing' constant as the value; or they may pass objects implementing the
> XNumberFormatsSupplier interface [3] - like current document.

Note that *some* functions really require something in this parameter. E.g., as
noted in [1], getWeeknum (and other functions taking dates) requires the passed
*property set* contain "NullDate" property, usually set to the Basic's null
date (unless user decides to pass a custom integer as the date), which can be
done using code like

 oPropBag = CreateUnoService("com.sun.star.beans.PropertyBag")
 oPropBag.addProperty("NullDate", 0, CDateToUnoDate(Empty))
 oService = CreateUnoService("com.sun.star.sheet.addin.Analysis")
 WkNum = oService.getWeeknum(oPropBag, CDate("2023-03-02"), 1)

(In reply to Mike Kaganski from comment #1)
> And also there should be documented the alternative (maybe preferred) way of
> calling those functions: using the same 'com.sun.star.sheet.FunctionAccess'
> service as suggested for all other functions, *but* stressing that one needs
> to use the full name of the function, like
> 'com.sun.star.sheet.addin.Analysis.getDec2Hex', there. That way, all the
> extra complexity is avoided.

Note that erAck has implemented simpler way to call these in bug 150203 (since
7.4.1). Now these can be called simply by their spreadsheet function name, as
other "normal" functions.

[1]
https://ask.libreoffice.org/t/cant-get-the-add-in-weeknum-function-to-work-in-macro/89294/4

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to