<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AJ</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AJ"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/AJ"/>
	<updated>2026-12-05T11:36:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/CompleteAddIn&amp;diff=79073</id>
		<title>Calc/Add-In/CompleteAddIn</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/CompleteAddIn&amp;diff=79073"/>
		<updated>2008-05-29T20:03:19Z</updated>

		<summary type="html">&lt;p&gt;AJ: Removed MyService2Impl:: from setLocale() and getLocale() because this is a syntax error in the class definition.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/Candidate}}&lt;br /&gt;
=An other C++ add-in example=&lt;br /&gt;
In this article under construction, a complete and simple add-in in C++ is presented.&lt;br /&gt;
==Introduction==&lt;br /&gt;
Before reading this article, please read [[Constructing_Components|Constructing Components]] and [[SimpleCalcAddIn]]. In SimpleCalcAddin you will learn most of important things like the tools involved in constructing an addin, the services involved and also the corresponding references to read in the devlopper&amp;#039;s guide. &lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s recall here how different files are created and what are the corresponding tools involved ? A drawing is beter than a long discussion :&lt;br /&gt;
&lt;br /&gt;
[[Image:ComponentTools.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see idlc is used to transform a .IDL-suffix file into a .urd-suffix file, regmerge to transform the previous .urd-suffix file into a .rdb-suffix file and so on... (see the corresponding [[SimpleCalcAddIn#Other_Files|SimpleCalcAddin]] compilation script and also [[Constructing_Components#Compilation_Chain_of_a_Component|Compilation Chain of a Component]]. The action done by the red arrow is not a file transformation but what is usually called registery. Before going further let&amp;#039;s note that starting from an idl file, we will generate an hpp file : this file automatically defines a C++ class that we will use in the cxx file.&lt;br /&gt;
&lt;br /&gt;
You can go further with component and Java [[JavaEclipseTuto|here]]. &lt;br /&gt;
&lt;br /&gt;
We choose here an other way : starting  from an example of SDK slightly modified :&lt;br /&gt;
&amp;lt;OpenOffice.org1.1_SDK&amp;gt;/examples/DevelopersGuide/Components/CppComponent&lt;br /&gt;
&lt;br /&gt;
I mean I will use this example makefile only modified to take into account the fact I only use one file instead the two provided by the example. The makefile compiles the component and installs it.&lt;br /&gt;
&lt;br /&gt;
==IDL File==&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding IDL file :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
// IDL&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XInitialization.idl&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XServiceName.idl&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XLocalizable.idl&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/sheet/XAddIn.idl&amp;gt;&lt;br /&gt;
module my_module&lt;br /&gt;
{&lt;br /&gt;
  interface XSomething : com::sun::star::uno::XInterface&lt;br /&gt;
{ // our four methods&lt;br /&gt;
  string methodOne( [in] string val );&lt;br /&gt;
  string methodTwo( [in] string val );&lt;br /&gt;
  long methodThree( [in] sequence&amp;lt; sequence&amp;lt; long &amp;gt; &amp;gt; aValList );&lt;br /&gt;
  sequence&amp;lt; sequence&amp;lt; long &amp;gt; &amp;gt; methodFour( [in] sequence&amp;lt; sequence&amp;lt; long &amp;gt; &amp;gt; aValList );&lt;br /&gt;
};&lt;br /&gt;
service MyService2&lt;br /&gt;
{&lt;br /&gt;
interface XSomething;&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
interface com::sun::star::lang::XServiceName;&lt;br /&gt;
interface com::sun::star::sheet::XAddIn;&lt;br /&gt;
};&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Four methods named methodOne, methodTwo, methodThree and methodFour can be seen in this IDL file and then will be implemented.&lt;br /&gt;
&lt;br /&gt;
We give the automatically generated C++ class with the cppumaker tool.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SAL_NO_VTABLE XSomething : public ::com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
&lt;br /&gt;
    // Methods&lt;br /&gt;
    virtual ::rtl::OUString SAL_CALL methodOne( const ::rtl::OUString&amp;amp; val ) throw&lt;br /&gt;
                     (::com::sun::star::uno::RuntimeException) = 0; &lt;br /&gt;
    virtual ::rtl::OUString SAL_CALL methodTwo( const ::rtl::OUString&amp;amp; val ) throw &lt;br /&gt;
                     (::com::sun::star::uno::RuntimeException) = 0;&lt;br /&gt;
    virtual sal_Int32 SAL_CALL methodThree( const ::com::sun::star::uno::Sequence&amp;lt; &lt;br /&gt;
                     ::com::sun::star::uno::Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt;&amp;amp; aValList ) throw&lt;br /&gt;
                           (::com::sun::star::uno::RuntimeException) = 0;&lt;br /&gt;
    virtual ::com::sun::star::uno::Sequence&amp;lt; ::com::sun::star::uno::Sequence&amp;lt; &lt;br /&gt;
                      sal_Int32 &amp;gt; &amp;gt; SAL_CALL methodFour( const ::com::sun::star::uno::Sequence&amp;lt;&lt;br /&gt;
                           ::com::sun::star::uno::Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt;&amp;amp; aValList ) throw &lt;br /&gt;
                               (::com::sun::star::uno::RuntimeException) = 0;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where again the four methods are seen but in C++ language. It&amp;#039;s time to give the corresponding code.&lt;br /&gt;
&lt;br /&gt;
==Implementing in C++ the corresponding four member Functions==&lt;br /&gt;
We first give the C++ code of the four methods presented in the previous IDL file.&lt;br /&gt;
&lt;br /&gt;
===The two first member functions===&lt;br /&gt;
The two first methods are similar :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
OUString MyService2Impl::methodOne( OUString const &amp;amp; str )&lt;br /&gt;
throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
  return OUString( RTL_CONSTASCII_USTRINGPARAM(&lt;br /&gt;
    &amp;quot;called methodOne() of MyService2 implementation: &amp;quot;) ) + m_arg + str;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString MyService2Impl::methodTwo( OUString const &amp;amp; str )throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
  return OUString( RTL_CONSTASCII_USTRINGPARAM(&lt;br /&gt;
    &amp;quot;called methodTwo() of MyService2 implementation: &amp;quot;) ) + m_arg + str;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
They only take a string (from a OOoCalc Cell) and add a message and put all the message+string in the result cell.&lt;br /&gt;
&lt;br /&gt;
===The third member Function===&lt;br /&gt;
The third member function is more complicated : it returns a value calculed from a cell range (the sum).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
sal_Int32 MyService2Impl::methodThree(const Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; &amp;amp;aValList )&lt;br /&gt;
throw (RuntimeException)&lt;br /&gt;
{ sal_Int32 n1, n2;&lt;br /&gt;
  sal_Int32 nE1 = aValList.getLength();&lt;br /&gt;
  sal_Int32 nE2;&lt;br /&gt;
  sal_Int32 temp=0;&lt;br /&gt;
  for( n1 = 0 ; n1 &amp;lt; nE1 ; n1++ )&lt;br /&gt;
  {&lt;br /&gt;
    const Sequence&amp;lt; sal_Int32 &amp;gt; rList = aValList[ n1 ];&lt;br /&gt;
    nE2 = rList.getLength();&lt;br /&gt;
    const sal_Int32* pList = rList.getConstArray();&lt;br /&gt;
    for( n2 = 0 ; n2 &amp;lt; nE2 ; n2++ )&lt;br /&gt;
    {&lt;br /&gt;
      temp += pList[ n2 ];&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return temp;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The fourth member Function===&lt;br /&gt;
The goal of the fourth member function is to show how we can implement a matrix function : starting from a cell range and obtaining a cell range.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//C++&lt;br /&gt;
//It&amp;#039;s a matrix operation should be called like : {=METHODFOUR(A1:B4)}&lt;br /&gt;
Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; MyService2Impl::methodFour(const Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; &amp;amp;aValList )&lt;br /&gt;
throw (RuntimeException)&lt;br /&gt;
{ sal_Int32 n1, n2;&lt;br /&gt;
  sal_Int32 nE1 = aValList.getLength();&lt;br /&gt;
  sal_Int32 nE2;&lt;br /&gt;
  Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; temp = aValList;&lt;br /&gt;
  for( n1 = 0 ; n1 &amp;lt; nE1 ; n1++ )&lt;br /&gt;
  {&lt;br /&gt;
    Sequence&amp;lt; sal_Int32 &amp;gt; rList = temp[ n1 ];&lt;br /&gt;
    nE2 = rList.getLength();&lt;br /&gt;
    for( n2 = 0 ; n2 &amp;lt; nE2 ; n2++ )&lt;br /&gt;
    {&lt;br /&gt;
      rList[ n2 ] += 4;&lt;br /&gt;
    }&lt;br /&gt;
    temp[n1]=rList;&lt;br /&gt;
  }&lt;br /&gt;
  return temp;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
What is done by this example is not great : only add four to every cells of the cell range and put the result in an other cell range.&lt;br /&gt;
&lt;br /&gt;
Every method are related to a C++ class named MyService2Impl. Let&amp;#039;s now give the corresponding class definition.&lt;br /&gt;
&lt;br /&gt;
===The C++ Class===&lt;br /&gt;
We use an helper to implement our class and then we don&amp;#039;t need to implement all the interfaces : no need to implement XInterface, XTypeProvider, XWeak for instance. We give now the corresponding C++ code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//C++&lt;br /&gt;
class MyService2Impl : public ::cppu::WeakImplHelper5&amp;lt;&lt;br /&gt;
      ::my_module::XSomething, lang::XServiceInfo, lang::XInitialization, lang::XServiceName,&lt;br /&gt;
	XAddIn&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    OUString m_arg;&lt;br /&gt;
public:&lt;br /&gt;
    // no need to implement XInterface, XTypeProvider, XWeak&lt;br /&gt;
    &lt;br /&gt;
    // XInitialization will be called upon createInstanceWithArguments[AndContext]()&lt;br /&gt;
    virtual void SAL_CALL initialize( Sequence&amp;lt; Any &amp;gt; const &amp;amp; args )&lt;br /&gt;
        throw (Exception);&lt;br /&gt;
    // XSomething&lt;br /&gt;
    virtual OUString SAL_CALL methodOne( OUString const &amp;amp; str )&lt;br /&gt;
        throw (RuntimeException);&lt;br /&gt;
    virtual OUString SAL_CALL methodTwo( OUString const &amp;amp; str )&lt;br /&gt;
        throw (RuntimeException);&lt;br /&gt;
    virtual sal_Int32 SAL_CALL methodThree(const Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; &amp;amp;aValList )&lt;br /&gt;
        throw (RuntimeException);&lt;br /&gt;
    virtual Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; SAL_CALL methodFour(&lt;br /&gt;
				const Sequence&amp;lt; Sequence&amp;lt; sal_Int32 &amp;gt; &amp;gt; &amp;amp;aValList )&lt;br /&gt;
	throw (RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // XServiceName&lt;br /&gt;
    virtual OUString SAL_CALL getServiceName() throw( uno::RuntimeException );&lt;br /&gt;
    // XServiceInfo&lt;br /&gt;
    virtual OUString SAL_CALL getImplementationName()&lt;br /&gt;
        throw (RuntimeException);&lt;br /&gt;
    virtual sal_Bool SAL_CALL supportsService( OUString const &amp;amp; serviceName )&lt;br /&gt;
        throw (RuntimeException);&lt;br /&gt;
    virtual Sequence&amp;lt; OUString &amp;gt; SAL_CALL getSupportedServiceNames()&lt;br /&gt;
        throw (RuntimeException);&lt;br /&gt;
    // XAddIn&lt;br /&gt;
    virtual OUString SAL_CALL getProgrammaticFuntionName( const OUString&amp;amp; aDisplayName ) &lt;br /&gt;
                throw( uno::RuntimeException );&lt;br /&gt;
    virtual OUString SAL_CALL getDisplayFunctionName( const OUString&amp;amp; aProgrammaticName ) &lt;br /&gt;
                throw( uno::RuntimeException );&lt;br /&gt;
    virtual OUString SAL_CALL getFunctionDescription( const OUString&amp;amp; aProgrammaticName ) &lt;br /&gt;
                throw( uno::RuntimeException );&lt;br /&gt;
    virtual OUString SAL_CALL getDisplayArgumentName(&lt;br /&gt;
        const OUString&amp;amp; aProgrammaticName, sal_Int32 nArgument ) throw( uno::RuntimeException );&lt;br /&gt;
    virtual OUString SAL_CALL getArgumentDescription(&lt;br /&gt;
        const OUString&amp;amp; aProgrammaticName, sal_Int32 nArgument ) throw( uno::RuntimeException );&lt;br /&gt;
    virtual OUString SAL_CALL getProgrammaticCategoryName(&lt;br /&gt;
        const OUString&amp;amp; aProgrammaticName ) throw( uno::RuntimeException );&lt;br /&gt;
    virtual OUString SAL_CALL getDisplayCategoryName(&lt;br /&gt;
        const OUString&amp;amp; aProgrammaticName ) throw( uno::RuntimeException );&lt;br /&gt;
    // XLocalizable&lt;br /&gt;
    virtual void SAL_CALL setLocale( const lang::Locale&amp;amp; eLocale ) throw( uno::RuntimeException );&lt;br /&gt;
    virtual lang::Locale SAL_CALL getLocale() throw( uno::RuntimeException );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code is not complete with the four methods as you can see in the class declaration. Only your own XSomething interface is already implemented (see [[CompleteAddIn#Implementing_in_C.2B.2B_the_corresponding_four_Methods|above]]). You can wonder how is it possible to find all the methods in the class ? As you will learn below, the IDL files corresponding to interfaces have to be read for that. The number of interfaces you have to implement is dependant of your goal. If you want to create a component you have to implement XInterface interface and add more code, if you want to make a scriptable component you still add more code (and more interfaces : XTypeprovider, XServiceInfo and XWeak) and if you want to create an AddIn you have to add more (XAddin, XServiceName). This is explained in Developper&amp;#039;s Guide. We first begin with a typical addin interface : XAddin.&lt;br /&gt;
&lt;br /&gt;
==The XAddIn Interface==&lt;br /&gt;
Every add-in have to implement the XAddIn interface. As usual what you have to do is described by an IDL file (or you can read the previous C++ class definition) :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
// IDL&lt;br /&gt;
module com { module sun { module star { module sheet {&lt;br /&gt;
interface XAddIn: com::sun::star::lang::XLocalizable&lt;br /&gt;
{&lt;br /&gt;
  string getProgrammaticFuntionName( [in] string aDisplayName );&lt;br /&gt;
  string getDisplayFunctionName( [in] string aProgrammaticName );&lt;br /&gt;
  string getFunctionDescription( [in] string aProgrammaticName );&lt;br /&gt;
  string getDisplayArgumentName(&lt;br /&gt;
  [in] string aProgrammaticFunctionName,&lt;br /&gt;
  [in] long nArgument );&lt;br /&gt;
  string getArgumentDescription(&lt;br /&gt;
  [in] string aProgrammaticFunctionName,&lt;br /&gt;
  [in] long nArgument );&lt;br /&gt;
  string getProgrammaticCategoryName( [in] string aProgrammaticFunctionName );&lt;br /&gt;
  string getDisplayCategoryName( [in] string aProgrammaticFunctionName );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The corresponding C++ code is given now without explanation (for the moment)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
// XAddIn&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getProgrammaticFuntionName( const OUString&amp;amp; aDisplayName ) throw(&lt;br /&gt;
                uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
// not used by calc&lt;br /&gt;
// (but should be implemented for other uses of the AddIn service)&lt;br /&gt;
  return OUString();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getDisplayFunctionName( const OUString&amp;amp; aProgrammaticName ) throw(&lt;br /&gt;
                uno::RuntimeException )&lt;br /&gt;
{ // a nested if implementation would be better&lt;br /&gt;
  OUString aProgName, aRet;&lt;br /&gt;
  aProgName = aProgrammaticName;&lt;br /&gt;
  if (aProgName.equalsAscii(&amp;quot;methodOne&amp;quot;)) aRet = OUString::createFromAscii(&amp;quot;method1&amp;quot;);&lt;br /&gt;
  if (aProgName.equalsAscii(&amp;quot;methodTwo&amp;quot;)) aRet = OUString::createFromAscii(&amp;quot;method2&amp;quot;);&lt;br /&gt;
  if (aProgName.equalsAscii(&amp;quot;methodThree&amp;quot;)) aRet = OUString::createFromAscii(&amp;quot;method3&amp;quot;);&lt;br /&gt;
  if (aProgName.equalsAscii(&amp;quot;methodFour&amp;quot;)) aRet = OUString::createFromAscii(&amp;quot;method4&amp;quot;);&lt;br /&gt;
  return aRet;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getFunctionDescription( const OUString&amp;amp; aProgrammaticName ) throw(&lt;br /&gt;
                uno::RuntimeException )&lt;br /&gt;
{ // a nested if implementation would be better&lt;br /&gt;
  OUString aRet;&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodOne&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;methodOne() : 1st try&amp;quot;);&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodTwo&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;methodTwo() : 1st try&amp;quot;);&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodThree&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;methodThree() : 1st try&amp;quot;);&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodFour&amp;quot;)) &lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;methodFour() : 1st try&amp;quot;);&lt;br /&gt;
  return aRet;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getDisplayArgumentName(&lt;br /&gt;
const OUString&amp;amp; aProgrammaticName, sal_Int32 nArgument ) throw( uno::RuntimeException )&lt;br /&gt;
{ // (requis) is added in French and probably (required) in English (see the snapshot below)&lt;br /&gt;
  OUString aRet;&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodOne&amp;quot;)||aProgrammaticName.equalsAscii(&amp;quot;methodTwo&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;a string&amp;quot;);&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodThree&amp;quot;)||aProgrammaticName.equalsAscii(&amp;quot;methodFour&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;a Cell Range&amp;quot;);&lt;br /&gt;
  return aRet;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getArgumentDescription(&lt;br /&gt;
const OUString&amp;amp; aProgrammaticName, sal_Int32 nArgument ) throw( uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
  OUString aRet;&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodOne&amp;quot;)||aProgrammaticName.equalsAscii(&amp;quot;methodTwo&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;method1/2:a string or a cell with a string is required&amp;quot;);&lt;br /&gt;
  if (aProgrammaticName.equalsAscii(&amp;quot;methodThree&amp;quot;)||aProgrammaticName.equalsAscii(&amp;quot;methodFour&amp;quot;))&lt;br /&gt;
    aRet = OUString::createFromAscii(&amp;quot;method3/4:a cell range is required&amp;quot;);&lt;br /&gt;
  return aRet;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getProgrammaticCategoryName(const OUString&amp;amp; aProgrammaticName ) throw(&lt;br /&gt;
                 uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
  OUString aRet( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;Add-In&amp;quot;));&lt;br /&gt;
  return aRet;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getDisplayCategoryName(const OUString&amp;amp; aProgrammaticName ) throw(&lt;br /&gt;
                  uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
  return getProgrammaticCategoryName( aProgrammaticName );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To understand what is this code related to, we provide a snapshot : read it carefully to see where the code works and provides the strings to print out in the autopilot frame :&lt;br /&gt;
&lt;br /&gt;
[[Image:Addin2.png]]&lt;br /&gt;
&lt;br /&gt;
I have used the method one as you can see above the autopilot frame, and I am ready to use  the method two. What you can read in the autopilot comes directly from the C++ code except the French word &amp;quot;requis&amp;quot; which is probably translated by &amp;quot;required&amp;quot; in an English OpenOffice version.&lt;br /&gt;
&lt;br /&gt;
== The XServiceName Interface==&lt;br /&gt;
&lt;br /&gt;
Again the corresponding IDL file indicates what we have to do :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
// IDL&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
interface XServiceName: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
  string getServiceName();&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This interface is simple : one method :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//C++&lt;br /&gt;
// XServiceName&lt;br /&gt;
OUString SAL_CALL MyService2Impl::getServiceName() throw( uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
// name of specific AddIn service&lt;br /&gt;
  return OUString::createFromAscii( &amp;quot;my_module.MyService2&amp;quot; );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The XServiceInfo Interface==&lt;br /&gt;
This Interface may be avoided. You have to implement it only if you want that your add-in is also scriptable : you can call it from OOoBasic for instance. It&amp;#039;s time to present the corresponding IDL file :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
// IDL&lt;br /&gt;
module com {  module sun {  module star {  module lang {&lt;br /&gt;
interface XServiceInfo: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
	string getImplementationName();&lt;br /&gt;
	boolean supportsService( [in] string ServiceName );&lt;br /&gt;
	sequence&amp;lt;string&amp;gt; getSupportedServiceNames();&lt;br /&gt;
};&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding C++ code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
// XServiceInfo implementation&lt;br /&gt;
OUString MyService2Impl::getImplementationName()&lt;br /&gt;
throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
// unique implementation name&lt;br /&gt;
  return OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;my_module.my_sc_impl.MyService2&amp;quot;) );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sal_Bool MyService2Impl::supportsService( OUString const &amp;amp; serviceName )&lt;br /&gt;
throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
// this object only supports one service, so the test is simple&lt;br /&gt;
  if (serviceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(&amp;quot;my_module.MyService2&amp;quot;) ))&lt;br /&gt;
    return true;&lt;br /&gt;
  if (serviceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(&amp;quot;com.sun.star.sheet.AddIn&amp;quot;) ))&lt;br /&gt;
    return true;&lt;br /&gt;
  else return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Sequence&amp;lt; OUString &amp;gt; MyService2Impl::getSupportedServiceNames()&lt;br /&gt;
throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
  return getSupportedServiceNames_MyService2Impl();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt; XInterface &amp;gt; SAL_CALL create_MyService2Impl(Reference&amp;lt; XComponentContext &amp;gt; const &amp;amp; xContext)&lt;br /&gt;
SAL_THROW( () )&lt;br /&gt;
{&lt;br /&gt;
  return static_cast&amp;lt; lang::XTypeProvider * &amp;gt;( new MyService2Impl() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==XInitialisation Interface==&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding C++ code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
// XInitialization implemention&lt;br /&gt;
void MyService2Impl::initialize( Sequence&amp;lt; Any &amp;gt; const &amp;amp; args )&lt;br /&gt;
    throw (Exception)&lt;br /&gt;
{&lt;br /&gt;
    if (1 != args.getLength())&lt;br /&gt;
    {&lt;br /&gt;
        throw lang::IllegalArgumentException(&lt;br /&gt;
            OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;give a string instanciating this component!&amp;quot;) ),&lt;br /&gt;
            (::cppu::OWeakObject *)this, // resolve to XInterface reference&lt;br /&gt;
            0 ); // argument pos&lt;br /&gt;
    }&lt;br /&gt;
    if (! (args[ 0 ] &amp;gt;&amp;gt;= m_arg))&lt;br /&gt;
    {&lt;br /&gt;
        throw lang::IllegalArgumentException(&lt;br /&gt;
            OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;no string given as argument!&amp;quot;) ),&lt;br /&gt;
            (::cppu::OWeakObject *)this, // resolve to XInterface reference&lt;br /&gt;
            0 ); // argument pos&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==XLocalizable Interface==&lt;br /&gt;
&lt;br /&gt;
This interface is particular : we have let it in the class definition and give now the corresponding code but because the code do nothing, we don&amp;#039;t add it as sixth interface when using the helper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
// XLocalizable&lt;br /&gt;
void SAL_CALL MyService2Impl::setLocale( const lang::Locale&amp;amp; eLocale ) throw( uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
//    aFuncLoc = eLocale;&lt;br /&gt;
//    InitData();     // change of locale invalidates resources!&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
lang::Locale SAL_CALL MyService2Impl::getLocale() throw( uno::RuntimeException )&lt;br /&gt;
{&lt;br /&gt;
//    return aFuncLoc;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Making a registerable component==&lt;br /&gt;
An add-in has to be registered. In fact if you want to use external code, you have to work with a registry. If you use your external code with OOoBasic you call it a component and if you use it with OOoCalc you call it an add-in. But both are very similar. In my knowledge the only exception to this registry rule is OOoBasic (under Windows) which can call directly an external DLL.&lt;br /&gt;
&lt;br /&gt;
To supplement the above code we have to add :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// C++&lt;br /&gt;
/* shared lib exports implemented without helpers in service_impl1.cxx */&lt;br /&gt;
namespace my_sc_impl&lt;br /&gt;
{&lt;br /&gt;
static struct ::cppu::ImplementationEntry s_component_entries [] =&lt;br /&gt;
{&lt;br /&gt;
    {&lt;br /&gt;
        create_MyService2Impl, getImplementationName_MyService2Impl,&lt;br /&gt;
        getSupportedServiceNames_MyService2Impl, ::cppu::createSingleComponentFactory,&lt;br /&gt;
        0, 0&lt;br /&gt;
    },&lt;br /&gt;
    { 0, 0, 0, 0, 0, 0 }&lt;br /&gt;
};&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
extern &amp;quot;C&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
void SAL_CALL component_getImplementationEnvironment(&lt;br /&gt;
    sal_Char const ** ppEnvTypeName, uno_Environment ** ppEnv )&lt;br /&gt;
{&lt;br /&gt;
    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;&lt;br /&gt;
}&lt;br /&gt;
sal_Bool SAL_CALL component_writeInfo(&lt;br /&gt;
    lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry )&lt;br /&gt;
{&lt;br /&gt;
    return ::cppu::component_writeInfoHelper(&lt;br /&gt;
        xMgr, xRegistry, ::my_sc_impl::s_component_entries );&lt;br /&gt;
}&lt;br /&gt;
void * SAL_CALL component_getFactory(&lt;br /&gt;
    sal_Char const * implName, lang::XMultiServiceFactory * xMgr,&lt;br /&gt;
    registry::XRegistryKey * xRegistry )&lt;br /&gt;
{&lt;br /&gt;
    return ::cppu::component_getFactoryHelper(&lt;br /&gt;
        implName, xMgr, xRegistry, ::my_sc_impl::s_component_entries );&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Utilities=&lt;br /&gt;
In order to provide utilities to interface OOo to other external libraries, we will provide in this section any utilities to transform classical variables into UNO variables.&lt;br /&gt;
&lt;br /&gt;
==Transforming sequence of sequence into  array==&lt;br /&gt;
&lt;br /&gt;
If you plan to extend OOoCalc in any way, you will probably use an external library, for instance a C library like GSL. You will notice that the variables are in general arrays of double and not sequence. &lt;br /&gt;
Have a look to the case of Listing below where you see an imaginary method « foo ». The point is we use a sequence of sequence as parameter and we want to transform it into 2D array.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//C+&lt;br /&gt;
Sequence&amp;lt; Sequence&amp;lt; double &amp;gt; &amp;gt; MyService2Impl::foo(&lt;br /&gt;
		const Sequence&amp;lt; Sequence&amp;lt; double &amp;gt; &amp;gt; &amp;amp;aValList )throw (RuntimeException)&lt;br /&gt;
{ 		sal_Int32		nE1 = aValList.getLength();&lt;br /&gt;
	sal_Int32		nE2;&lt;br /&gt;
&lt;br /&gt;
	Sequence&amp;lt; double &amp;gt;	rList = aValList[ 0 ];&lt;br /&gt;
	nE2 = rList.getLength();&lt;br /&gt;
	double table[nE1][nE2];&lt;br /&gt;
	for( sal_Int32 n1 = 0 ; n1 &amp;lt; nE1; n1++ )&lt;br /&gt;
	{&lt;br /&gt;
		for (sal_Int32 n2=0;n2&amp;lt;nE2;n2++)&lt;br /&gt;
			table[n1][n2]=aValList[n1][n2];&lt;br /&gt;
	}&lt;br /&gt;
// we have a 2D array now&lt;br /&gt;
//!!!!!!!! This code is wrong : double table[nE1][nE2]; with nE1 and nE2 &lt;br /&gt;
//!!!!!!!! unknown at the compilation time. !!!!!!!!&lt;br /&gt;
// I have used this code with success but I don&amp;#039;t know why ? &lt;br /&gt;
// Perhaps the compiler use a constructor in this case ?&lt;br /&gt;
// I will have a look as sooner as possible&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
At the end of this program we have a 2D array named « table » and we show how to construct it. (I have tried a way using getArray() but without success).&lt;br /&gt;
&lt;br /&gt;
As mentioned in the comments, this code has a poor quality in my knowledge. At the moment, I provide other code [[SDKCppLanguage#More_Abstractions_with_STL|here]]&lt;br /&gt;
&lt;br /&gt;
==Transforming an Array into Sequence of Sequence==&lt;br /&gt;
&lt;br /&gt;
Imagine your calculus provides a 1D array named « z » and you want to construct a sequence of sequence before returning it. Here is what you could do :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//C+&lt;br /&gt;
...&lt;br /&gt;
// here a line is constructed with size (nE2-1)*2&lt;br /&gt;
	Sequence&amp;lt; double &amp;gt;	solList1D(z,(nE2-1)*2);&lt;br /&gt;
	Sequence&amp;lt; Sequence&amp;lt; double &amp;gt; &amp;gt; solList2D(1);&lt;br /&gt;
	solList2D[0]=solList1D;&lt;br /&gt;
	return solList2D;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A similar problem encountered later has to be solved differently : I start from an 1D array but this array contains, real part and imaginary part « The n-1 roots are returned in the packed complex array z of length 2(n-1), alternating real and imaginary parts » I want to show the result in Calc but with two rows (real part and imaginary part) with as many lines as necessary. Here is the way :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//C+&lt;br /&gt;
...&lt;br /&gt;
// two rows and nE2-1 lines starting from an array &amp;quot;z&amp;quot; with (nE2-1)*2 lements&lt;br /&gt;
	Sequence&amp;lt; double &amp;gt;	solList1D(2);&lt;br /&gt;
		Sequence&amp;lt; Sequence&amp;lt; double &amp;gt; &amp;gt; solList2D(nE2-1);&lt;br /&gt;
		for( int j=0;j&amp;lt;((nE2-1)&amp;lt;&amp;lt;1);j+=2){ // (nE2-1)&amp;lt;&amp;lt;1 is faster than (nE2-1)*2&lt;br /&gt;
			for( int i=0; i&amp;lt;2 ; i++){&lt;br /&gt;
				solList1D[i]=z[i+j];&lt;br /&gt;
			}&lt;br /&gt;
			solList2D[j&amp;gt;&amp;gt;1]=solList1D;//j &amp;gt;&amp;gt; 2 is faster than j/2&lt;br /&gt;
		}&lt;br /&gt;
		return solList2D;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes we have to use Standard Template Library because the library we want to interface is in C++. Eric Ehlers has interfaced a C++ library (QuantLib project) and then provide any interesting code [http://www.quantlibaddin.org here]. See particularly the file calcutils.cpp. I have reproduct part of the code [[SDKCppLanguage#More_Abstractions_with_STL|here]] but with using template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:HomePageCpp.png]] [[Using_Cpp_with_the_OOo_SDK|Return to Document Home page]]&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This article is under construction&amp;#039;&amp;#039;&amp;#039; and if you want to go further, for the moment have a look to the following references :&lt;br /&gt;
* [[Uno/Cpp/Tutorials/Introduction_to_Cpp_Uno|C++ and UNO tutorial]]&lt;br /&gt;
*[[Tutorial_UNO_Library|UNO tutorial]]&lt;br /&gt;
*[[Tutorial_UNO_IDL|UNO IDL]]&lt;br /&gt;
* [[Uno/Article/Types%26Reflection]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[Calc/Add-In/Project_Type|Java Calc Add-in]]&lt;br /&gt;
* [[API/Samples/Java/CalcAddin|An other Java Calc Add-in example]]&lt;br /&gt;
* [http://perso.wanadoo.fr/moutou/MyUNODoc_HTML/UNOCppAPI14.html Add-in : adding OooCalc functions] (Chapter 14 from UNO/C++ document) &lt;br /&gt;
* [http://www.oooforum.org/forum/viewtopic.phtml?t=29552 Add-In in C++]&lt;br /&gt;
* [http://sc.openoffice.org/addin_howto.html How to add-in in OpenOffice.org Calc]&lt;br /&gt;
* [http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/AddIn.html Service AddIn Documentation]&lt;br /&gt;
* [http://perso.wanadoo.fr/moutou/MyUNODoc_HTML/UNOCppAPI13.html Constructing Components]&lt;br /&gt;
* Writing a Program to Control OpenOffice.org, by Franco Pingiori — [http://www.linuxjournal.com/article/8550 Part 1] and [http://www.linuxjournal.com/article/8608 Part 2], Linux Journal&lt;br /&gt;
*All my UNO/C++ document is available here http://perso.wanadoo.fr/moutou/MyUNODoc_HTML/UNOCppAPI.html&lt;br /&gt;
* [[SDKInstallation | How to install the SDK and compile the C++ examples]]&lt;br /&gt;
* [[SDKCppLanguage | The UNO C++ Language]]&lt;br /&gt;
* QuantLibAddin exports the functionality of the QuantLib analytics library as Addins on a variety of platforms including OpenOffice.org Calc and can be found here : http://quantlib.org/quantlibaddin/&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Add-Ins 10 Complete]]&lt;br /&gt;
[[Category:API|Calc]]&lt;br /&gt;
[[Category:Add-In|Calc]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Cpp]]&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>AJ</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Calc/Add-In/CompleteAddIn&amp;diff=79031</id>
		<title>Talk:Calc/Add-In/CompleteAddIn</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Calc/Add-In/CompleteAddIn&amp;diff=79031"/>
		<updated>2008-05-29T14:48:12Z</updated>

		<summary type="html">&lt;p&gt;AJ: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hope to bring help with this second add-in. &lt;br /&gt;
This article begins at 17th April but I take 15 days vacation. Be patient.&lt;br /&gt;
Please correct my English. &lt;br /&gt;
[[User:SergeMoutou|SergeMoutou]]&lt;br /&gt;
&lt;br /&gt;
: You can use &amp;quot;Move&amp;quot; to change the name of your article.&lt;br /&gt;
: Good to see you are back, --[[User:St|stx12]] 21:27, 2 May 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
I have done a little mistake with the &amp;quot;move&amp;quot; command and then lost the discussion corresponding to this article. I hope the discussion is automatically deleted when there is no corresponding article. If not I think its name is ComplexAddin and can be deleted.&lt;br /&gt;
: The talk page is still available at [[Talk:ComplexAddIn]]. Feel free to mark it for deletion with the template &amp;lt;nowiki&amp;gt;{{delete}}&amp;lt;/nowiki&amp;gt;. --[[User:St|stx12]] 09:40, 11 May 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
I don&amp;#039;t see where the source code is available for this example, please upload the full source code so that readers may see the whole project rather than just parts. --[[User:AJ|AJ]] 16:48, 29 May 2008 (CEST)&lt;/div&gt;</summary>
		<author><name>AJ</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User_talk:Ccornell&amp;diff=71679</id>
		<title>User talk:Ccornell</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User_talk:Ccornell&amp;diff=71679"/>
		<updated>2008-03-25T17:32:30Z</updated>

		<summary type="html">&lt;p&gt;AJ: New section: Syntax Highlighting for the Color Blind&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I tried to setup the menu structure for the [[Documentation/OOoAuthors User Manual/Getting Started/Starting OpenOffice.org|second chapter]]. But I seem to run into trouble in that I can&amp;#039;t figure out how to get the pages within the chapter to show up in the menu. Could you check to see what I&amp;#039;m doing wrong?&lt;br /&gt;
&lt;br /&gt;
--[[User:Kirk|Kirk]] 00:45, 18 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Nevermind, I seem to have figured it out. --[[User:Kirk|Kirk]] 00:35, 19 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
:: It&amp;#039;s a little complex to begin with, but once you see the pattern of how the TOC works, it starts to make sense :-)  I made a small change to the template - changed max-width to just width.  Internet Explorer is a broken browser, and does not respect CSS standards very well.  It doesn&amp;#039;t know max-width, so the easy solution is just to use a fixed width for the TOC.  --[[User:Ccornell|Ccornell]] 08:41, 19 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==New Template problem==&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m having a bit of difficulty getting the revised template to show the next page in a document. Could you have a look at [[Template:Documentation/ImpressFormattingTOC]]? Everything else seems to be working okay, I just can&amp;#039;t seem see what I&amp;#039;m missing on that part. --[[User:Kirk|Kirk]] 03:24, 13 December 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
: You have implemented the TOC correctly.  When you look at the TOC page itself, you will see it shown as you see it on the link above (the raw TOC, not the TOC as it is shown when included in a content page).  The Next and Previous page parts of the TOC will show (in the raw TOC) as &amp;lt;nowiki&amp;gt;[[{{{PrevPage}}}|&amp;lt; Previous Page]]&amp;lt;/nowiki&amp;gt; and &amp;lt;nowiki&amp;gt;[[{{{NextPage}}}|Next Page &amp;gt;]]&amp;lt;/nowiki&amp;gt; on the TOC page itself - this is because the variables for the Next and Previous pages have not yet been given to the template.  &lt;br /&gt;
: When the TOC is included in a content page and you pass the Next and Previous variables, the links will be created on the content page. --[[User:Ccornell|Ccornell]] 11:49, 2 January 2008 (CET)&lt;br /&gt;
&lt;br /&gt;
== Syntax Highlighting for the Color Blind ==&lt;br /&gt;
&lt;br /&gt;
Hey,&lt;br /&gt;
&lt;br /&gt;
I couldn&amp;#039;t find an appropriate place to bring this up elsewhere, so I decided to contact you.  I&amp;#039;m color blind, and I&amp;#039;m having a very hard time reading source code which is syntax-highlighted.  I wind up having to select text, and read the selected text, or paste to another program.&lt;br /&gt;
&lt;br /&gt;
The cyan (I think?) syntax color is nearly invisible for me, and entirely unreadable.  See for example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// 4-parameter template&lt;br /&gt;
class RNG_impl : public ::cppu::WeakImplHelper4&amp;lt;&lt;br /&gt;
        ::org::openoffice::sheet::addin::XRNG,&lt;br /&gt;
        ::sheet::XAddIn,&lt;br /&gt;
        lang::XServiceName,&lt;br /&gt;
        lang::XServiceInfo &amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>AJ</name></author>
	</entry>
</feed>