Programming Calc-Addin in C++ with CellAdress

Lars Callenbach lars.callenbach at gmx.de
Wed Jun 17 13:10:11 PDT 2015


I would like to get the adress of the cell in which an Add-In function
is called. How do I have to extend the IDL-file 
---
#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/lang/XInitialization.idl>
#include <com/sun/star/lang/XServiceName.idl>
#include <com/sun/star/lang/XLocalizable.idl>
#include <com/sun/star/sheet/XAddIn.idl>
#include <com/sun/star/table/CellAddress.idl>

module my_module
{
  interface XSomething : com::sun::star::uno::XInterface
{ // our four methods
  string methodOne( [in] string val );
};
service MyService2
{
interface XSomething;
interface com::sun::star::lang::XInitialization;
interface com::sun::star::lang::XServiceName;
interface com::sun::star::sheet::XAddIn;
};
};
---
and how can I access the cell in the C++ code for the method?
---
OUString MyService2Impl::methodOne( OUString const & str )
    throw (RuntimeException)
{
    return OUString( RTL_CONSTASCII_USTRINGPARAM(
        "called methodOne() of MyService2 implementation: ") ) + m_arg +
str + ??CELLADDRESS??;
}
---
I would like to log information about the calling method, its
position/cell address in Calc and further information about
exceptions/wrong data. 


Help appreciated,
   Lars




More information about the LibreOffice mailing list