Object Linking and Embedding in LibreOffice

Miklos Vajna vmiklos at collabora.co.uk
Tue Oct 1 03:25:24 PDT 2013


Hi Badal,

On Tue, Oct 01, 2013 at 02:46:54PM +0530, Badal Naik <badal.kumar.naik at ericsson.com> wrote:
> Many thanks for your promt reply. I have designed the UI, and
> created the "display as icon" there. Have modified the
> "insertoleobject.ui " file under /cui/uiconfig/ui...Does not have
> much exposure to ODF Import /ww8 import filter. Request to please
> give me some pointer on this..

As far as I see, both file formats store the "icon" just like any other
replacement image, it's just the UI that makes this choice possible for
the user. I mean, from the UI perspective, you still need to produce a
replacement image.

To do so, I guess you need to answer two questions:

1) How do I get the application icon / name that should be on the image?

2) What is the API to produce an image based on those infos?

For the later, I guess one readable example is how the DOCX import
filter creates OLE objects (using the UNO API) with replacement
graphics:

http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper_Impl.cxx#1241

I.e. create a text::TextEmbeddedObject, set the StreamName, Width,
Height, Graphic properties, and attach it to the document as text
content.

More reference here:

http://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1text_1_1TextEmbeddedObject.html

The UI typically uses the internal API, though, so you may want to look
into how the TextEmbeddedObject is implemented, which is the
SwXTextEmbeddedObject class:

http://opengrok.libreoffice.org/xref/core/sw/inc/unoframe.hxx#282
http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unoframe.cxx#2951

E.g. in the getEmbeddedObject() method you get the idea where to dig
further:
- the document model stores the OLE object as an SwOLENode
- the generic (not Writer-specific) embedded UNO interface is
  embed::XEmbeddedObject
- the generic internal API is svt::EmbeddedObjectRef

Hope this helps,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20131001/d49e26ed/attachment.pgp>


More information about the LibreOffice mailing list