zotero / zotero-libreoffice-integration

Zotero LibreOffice integration
https://www.zotero.org/support/libreoffice_writer_plugin_usage
Other
68 stars 30 forks source link

Disable track changes when inserting/editing citations #63

Closed adomasven closed 2 years ago

adomasven commented 2 years ago

See https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1text_1_1GenericTextDocument.html#a6649fa1a4963f78b9d70a85edef770e4 for API docs

raffaem commented 2 years ago

I came up with:

XPropertySet docPropSet = UnoRuntime.queryInterface(XPropertySet.class, textDocument);
boolean recordChanges = (Boolean) docPropSet.getPropertyValue("RecordChanges");
docPropSet.setPropertyValue("RecordChanges", false);

but I don't know where to put it.

Looks like Document::insertMarkAtRange is not the correct place, as it is called right after you click "Add/Edit Citation", and not when the citation is actually added.