Do you have the document “SimpleComponent.odt” from that directory? Open it and click on the button to run it.
It looks like this component implements a service, not a Calc Add-In.
An example of a Python add-in is REVERSE()
from https://extensions.libreoffice.org/extensions/lingtools The .idl file:
#include <com/sun/star/uno/XInterface.idl>
module name { module JimK { module LinguisticTools { module CalcFunctions {
interface XCalcFunctions
{
string reverse( [in] string s );
};
}; }; }; };
The .xcu file:
<?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="name.JimK.LinguisticTools.ReverseStringImpl" oor:op="replace">
<node oor:name="AddInFunctions">
<node oor:name="reverse" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">reverse</value></prop>
<prop oor:name="Description">
<value xml:lang="en">Flips a string backwards. For example "apple" becomes "elppa".</value>
</prop>
<prop oor:name="Category"><value>Add-In</value></prop>
<!-- This won't help, because there is no reverse() in Excel. -->
<prop oor:name="CompatibilityName"><value xml:lang="en">reverse</value></prop>
<node oor:name="Parameters">
<node oor:name="s" oor:op="replace">
<prop oor:name="DisplayName"><value xml:lang="en">s</value></prop>
<prop oor:name="Description"><value xml:lang="en">The string to reverse.</value></prop>
</node>
</node>
</node>
</node>
</node>
</node>
</oor:component-data>
The manifest.xml:
<!-- Files that describe the extension and its components -->
<manifest:file-entry
manifest:full-path="CalcAddIns.xcu"
manifest:media-type="application/vnd.sun.star.configuration-data"/>
<!-- Compiled type library for the Calc addin -->
<manifest:file-entry
manifest:full-path="idl/XCalcFunctions.rdb"
manifest:media-type="application/vnd.sun.star.uno-typelibrary;type=RDB"/>
Finally, the implementation:
def reverseString(inString):
s = unicode(inString)
# This is extended slice syntax [begin:end:step]. With a step of -1,
# it will traverse the string elements in descending order.
return s[::-1]
To call it, enter the formula =REVERSE("apple")
.
For a C++ example, see Calc/Add-In/Simple Calc Add-In - Apache OpenOffice Wiki.