My own implementation of the Complete Add-In is a bit disheveled, and I don't actually use it. Like I said, it's mostly useful for getting a shell set up. I have it with both XAddin
and CalcAddin.xcu, which has the messy result that if I install it, the method names are all duplicated in the function wizard. They do work, however!
My CalcAddin.xcu looks like
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="CalcAddIns" oor:package="org.openoffice.Office">
<node oor:name="AddInInfo">
<node oor:name="mymodule.my_sc_implementation.MyService2Impl" oor:op="replace">
<node oor:name="AddInFunctions">
<node oor:name="methodOne" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">method1</value></prop>
<prop oor:name="Description"><value xml:lang="en">add Message.</value></prop>
<prop oor:name="Category"><value>Add-In</value></prop>
<node oor:name="Parameters">
<node oor:name="val" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">val</value></prop>
<prop oor:name="Description"><value xml:lang="en">String.</value></prop>
</node>
</node>
</node>
<node oor:name="methodTwo" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">method2</value></prop>
<prop oor:name="Description"><value xml:lang="en">add Message.</value></prop>
<prop oor:name="Category"><value>Add-In</value></prop>
<node oor:name="Parameters">
<node oor:name="val" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">val</value></prop>
<prop oor:name="Description"><value xml:lang="en">String</value></prop>
</node>
</node>
</node>
<node oor:name="methodThree" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">method3</value></prop>
<prop oor:name="Description"><value xml:lang="en">sum cell range</value></prop>
<prop oor:name="Category"><value>Add-In</value></prop>
<node oor:name="Parameters">
<node oor:name="aValList" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">aValList</value></prop>
<prop oor:name="Description"><value xml:lang="en">Number Code.</value></prop>
</node>
</node>
</node>
<node oor:name="methodFour" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">method4</value></prop>
<prop oor:name="Description"><value xml:lang="en">matrix tricks</value></prop>
<prop oor:name="Category"><value>Add-In</value></prop>
<node oor:name="Parameters">
<node oor:name="aValList" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">aValList</value></prop>
<prop oor:name="Description"><value xml:lang="en">Cell Range.</value></prop>
</node>
</node>
</node>
</node>
</node>
</node>
</oor:component-data>
I'm not using the compatability names at all, I think that's just for getting the equivalent add-in for Excel -- which doesn't exist anyway, I don't think. I think the variable names need to agree with the .idl file, but I'm not sure whether the names in the c++ program need to agree, I always just use the same names as in the .idl anyway (the data types definitely have to match!).
A key thing is the "AddInInfo," and mine is probably different from yours.
Code: Select all
<node oor:name="AddInInfo">
<node oor:name="mymodule.my_sc_implementation.MyService2Impl" oor:op="replace">
That comes from this function in the c++:
Code: Select all
static OUString getImplementationName_MyService2Impl()
{
static OUString *pImplName = 0;
if( ! pImplName )
{
// MutexGuard guard( Mutex::getGlobalMutex() );
if( ! pImplName )
{
static OUString implName( RTL_CONSTASCII_USTRINGPARAM("mymodule.my_sc_implementation.MyService2") );
pImplName = &implName;
}
}
return *pImplName;
}
That also shows up in the .rdb file.
| Edit: <node oor:name="mymodule.my_sc_implementation.MyService2Impl" oor:op="replace"> may or may not require the Impl on the end. Though my Complete Add-In example has Impl, later things I've done do without it. |