Hi,
in java I try to write a add-on that creates a bookmark at the current cursor
location in a swriter document.
The following code works well for usual texts passages in swriter.
When I run the add-ons with the current cursor location in a table (pure
openoffice tabel, no shreadsheet) it does not work.
How do I handle this case?
//retrieve current cursor position
// get the XModel interface from the component
XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class,
xComponent);
// the model knows its controller
XController xController = xModel.getCurrentController();
// the controller gives us the TextViewCursor
// query the viewcursor supplier interface
XTextViewCursorSupplier xViewCursorSupplier =
(XTextViewCursorSupplier)UnoRuntime.queryInterface(
XTextViewCursorSupplier.class, xController);
// get the cursor
XTextViewCursor xViewCursor =
xViewCursorSupplier.getViewCursor();
xDocText.insertTextContent( xViewCursor , xTextContent, false );
Cheers Max
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]