use of com.sun.star.beans.XPropertySet in project jabref by JabRef.
the class OOBibBase method italicizeOrBold.
private void italicizeOrBold(XTextCursor position, boolean italicize, int start, int end) throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
XTextRange range = position.getStart();
XTextCursor cursor = position.getText().createTextCursorByRange(range);
cursor.goRight((short) start, false);
cursor.goRight((short) (end - start), true);
XPropertySet xcp = UnoRuntime.queryInterface(XPropertySet.class, cursor);
if (italicize) {
xcp.setPropertyValue("CharPosture", com.sun.star.awt.FontSlant.ITALIC);
} else {
xcp.setPropertyValue("CharWeight", com.sun.star.awt.FontWeight.BOLD);
}
}
Aggregations