Hello Jan, this is now an API thread, so I'd suggest moving to [email protected] ([email protected] is for development on OOo source code, [email protected] for API developers).
On Wednesday 18 March 2009, 10:54, Jan Holst Jensen wrote: > 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. [copy&paste from my mail in http://api.openoffice.org/servlets/ReadMsg?list=dev&msgNo=19781] there is [an elegant?!] solution taking care of the supported types for functions arguments, as described in the service com.sun.star.sheet.AddIn http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/AddIn.html Playing with them you can define OPTIONAL arguments [I mean of type "[Minimum Length]" in BASE( Number; Radix; [Minimum Length] )] and VARIABLE arguments [like in IMPRODUCT(complex number; complex number 1; ...)] > 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 ? I'll send you a Java example, just look at the IDL and the CalcAddIns.xcu > Alternatively, is it more correct now-a-days to use a CalcAddin.xcu file > instead of implementing XAddIn ? yes > 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. AFAIK there is no other documentation than the schema /opt/openoffice.org/basis3.1/share/registry/schema/org/openoffice/Office/CalcAddIns.xcs http://svn.services.openoffice.org/opengrok/xref/DEV300_m43/officecfg/registry/schema/org/openoffice/Office/CalcAddIns.xcs The Dev's Guide chap. about Add-ins is from the stone age. Regards -- Ariel Constenla-Haile La Plata, Argentina "Aus der Kriegsschule des Lebens - Was mich nicht umbringt, macht mich härter." Nietzsche Götzendämmerung, Sprüche und Pfeile, 8. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
