Search in sources :

Example 6 with XTextViewCursor

use of com.sun.star.text.XTextViewCursor in project zotero-libreoffice-integration by zotero.

the class Document method insertField.

public ReferenceMark insertField(String fieldType, int noteType) throws Exception {
    // duplicate selection cursor
    XTextViewCursor selectionCursor = getSelection();
    XTextCursor rangeToInsert = (XParagraphCursor) UnoRuntime.queryInterface(XParagraphCursor.class, selectionCursor.getText().createTextCursorByRange(selectionCursor));
    return insertMarkAtRange(fieldType, noteType, rangeToInsert, null, null);
}
Also used : XParagraphCursor(com.sun.star.text.XParagraphCursor) XTextCursor(com.sun.star.text.XTextCursor) XTextViewCursor(com.sun.star.text.XTextViewCursor)

Aggregations

XTextViewCursor (com.sun.star.text.XTextViewCursor)6 XPropertySet (com.sun.star.beans.XPropertySet)3 XParagraphCursor (com.sun.star.text.XParagraphCursor)2 XTextRange (com.sun.star.text.XTextRange)2 XTextViewCursorSupplier (com.sun.star.text.XTextViewCursorSupplier)2 Point (com.sun.star.awt.Point)1 PropertyVetoException (com.sun.star.beans.PropertyVetoException)1 UnknownPropertyException (com.sun.star.beans.UnknownPropertyException)1 XEnumeration (com.sun.star.container.XEnumeration)1 XEnumerationAccess (com.sun.star.container.XEnumerationAccess)1 XNamed (com.sun.star.container.XNamed)1 XModel (com.sun.star.frame.XModel)1 DisposedException (com.sun.star.lang.DisposedException)1 IllegalArgumentException (com.sun.star.lang.IllegalArgumentException)1 WrappedTargetException (com.sun.star.lang.WrappedTargetException)1 XFootnote (com.sun.star.text.XFootnote)1 XText (com.sun.star.text.XText)1 XTextContent (com.sun.star.text.XTextContent)1 XTextCursor (com.sun.star.text.XTextCursor)1 XTextSection (com.sun.star.text.XTextSection)1