Hi Max,

On Tuesday, 2007-07-31 21:55:18 +0200, Max Giesbert wrote:

> The constructor gets a XComponentContext passed over. Now how do I get
> the XComponent of the actually opened spreadsheet from it?

XComponentContext is not related to the current application or
documents. It provides information about the UNO context in which your
component was constructed, such as the service factory used.

To obtain the current spreadsheet document that has UI focus (!) use
service com.sun.star.frame.Desktop interface com.sun.star.lang.XDesktop
method getCurrentComponent(), see also
http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XDesktop.html

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to this [EMAIL PROTECTED] account, which I use 
for
 mailing lists only and don't read from outside Sun. Use [EMAIL PROTECTED] 
Thanks.

Attachment: pgpLVWV4tJBtO.pgp
Description: PGP signature

Reply via email to