insert image ino calc doc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

insert image ino calc doc

k.misha
Hi!

How I need to initialize XShapes and XShape interfaces?

Reference< XShapes > xShapes(?);

Reference< XShape > xShape(?);

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: insert image ino calc doc

Ariel Constenla-Haile-2
On Fri, May 10, 2013 at 02:24:56PM +0300, k.misha wrote:
> Hi!
>
> How I need to initialize XShapes and XShape interfaces?
>
> Reference< XShapes > xShapes(?);

The draw page implements this interface. If we had more code
contributors, we could implement multiple inheritance; but that's not
the case, you have to live querying interfaces.

> Reference< XShape > xShape(?);

You have to create a shape at the document model's factory:

- the document model implements css.lang.XMultiServiceFactory to
  instantiate different objects, specified by their service name.
  file:///opt/openoffice.org/basis3.4/sdk/docs/common/ref/com/sun/star/lang/XMultiServiceFactory.html
  Use the service name com.sun.star.drawing.GraphicObjectShape to create
  an instance of a shape that holds an image
  file:///opt/openoffice.org/basis3.4/sdk/docs/common/ref/com/sun/star/drawing/GraphicObjectShape.html

- XMultiServiceFactory::createInstance wil return a reference to
  a generic css.uno.XInterface; query that reference for the
  css.drawing.XShape interface. Usually you will also need the
  css.beans.XPropertySet interface, to set the shapes properties.



Regards
--
Ariel Constenla-Haile
La Plata, Argentina

attachment0 (853 bytes) Download Attachment