Hi guys,

I'm currently stuck with the insertion of pictures into a XTextFrame. My goal is to insert a GraphicObject at a cursor position. If the cursor resides inside an XTextFrame, the size of the XTextFrame should be queried and the image should be scaled accordingly to fit the size of the XTextFrame. This behaviour can be done with "Insert -> Graphic" in the OO GUI while the cursor resides in a XTextFrame.

What I can do by now is:
- Embed a GraphicObject into an XTextContent. The method can of course also insert into the XTextFrame if the cursor was placed there.
- Get the XTextFrame via the XTextFramesSupplier
- Query the XServiceInfo for supported Services. ( XTextCursor, XTextRange and XTextViewCursor seem to not support com.sun.star.text.XTextFrame , so what should i use here?)

What I cannot do by now is:
- Getting the "surrounding content" of the XTextCursor, therefor I'm also not able to determine if the cursor is currently inside a XTextFrame. I need to find out if I'm inside a XTextFrame to query for the size of the XTextFrame to be able to resize the picture.

Am I on the right track with the XServiceInfo or do I have to use a different approach? And if there is an easier solution to embed GraphicObjects into a XTextFrame( and resize it accordingly), please tell me.

Regards,
Steffen Boersig

Offtopic: I solved my previous problem , with executing the same code several times, by upgrading to OO 3.2.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to