Hi.

Let's say that I want to implement the following interface in a Calc add-in so I get the Calc function JanFunc:

   interface XJan : com::sun::star::uno::XInterface
       {
string JanFunc( [in] string SomeText, [in] string OptionalText );
       };

and I want to be able to use both the form "=JANFUNC(A1;B1)" and "=JANFUNC(A1)" and have a suitable default value provided for the second optional parameter.

As far as I can understand I cannot specify that a parameter is optional directly in the UNO IDL, so I need to somehow tell the function wizard in Calc that the second parameter is optional and what its default value is, right ? I can see that the function wizard is capable of this, e.g. the "COUPDAYS" function.

The UNO component that I have based mine on is the tokencounter-calc-addin Python example which implements the XAddIn interface to provide info for the function wizard. However, I cannot figure out how the code would be able to indicate that a parameter is optional. Do any of you have a link to a Python example that supports optional parameters ?

Alternatively, is it more correct now-a-days to use a CalcAddin.xcu file instead of implementing XAddIn ? That could save me from cluttering my Python code with all this metadata. However, I would need some kind of reference as to the format of a CalcAddin.xcu file - I cannot seem to find it anywhere.

Cheers
-- Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to