[libreoffice-dev] - questions about calc extension

Kohei Yoshida kohei.yoshida at gmail.com
Wed Jan 9 10:41:17 PST 2013


On 01/09/2013 01:12 PM, Rai, Neeraj wrote:
> Q1. When I try to use the xContext = cppu::bootstrap() in a calc
> extension, app terminate with throwing an exception :
>          cppu::BootstrapException
>       It works well in standalone exec.

Yes, that's only for "standalone exec" (or whatever we are supposed to 
call it), not for extensions.

What is the correct way to get a
> handle to spreadsheet in extension code.

I don't want you to look too close to this (since I no longer maintain 
this), bug this code of mine

http://code.google.com/p/scsolver/source/browse/source/ui/xcalc.cxx

may give you some hint, especially the top 3 methods, 
getCurrentComponent(), updateCurrentComponent(), and getServiceManager() 
should give you how to get the current component object from the current 
context object.  As an extension, you are given access to the current 
context object, and you can reach the current component from that one 
way or another.

> Q2. I came across an example extension code that registers 4 methods.
> One of the methods takes sequence of sequence
>          and returns a sequence of sequence after adding 4 to it.
>        When I call this example by hitting <F2> (insert function) and
> choosing that funcname, and giving it a range of cell, the cell is
> populated with the value of 1st  cell + 4
>       How can I update multiple cells using a custom written function.

Not sure if I understand this fully.  Can you post the URL to the 
example extension code that you are referring to?

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc


More information about the LibreOffice mailing list