Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.model.openoffice.uno

public Class UnoRedlines

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Optional, com.sun.star.beans.PropertyVetoException, com.sun.star.beans.UnknownPropertyException, com.sun.star.beans.XPropertySet, com.sun.star.container.NoSuchElementException, com.sun.star.container.XEnumeration, com.sun.star.container.XEnumerationAccess, com.sun.star.document.XRedlinesSupplier, com.sun.star.lang.WrappedTargetException, com.sun.star.text.XTextDocument, com.sun.star.text.XTextRange, org.jspecify.annotations.Nullable

Change tracking and Redlines

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static class

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int
countDeletedRangesTouching(com.sun.star.text.XTextDocument doc, List<com.sun.star.text.XTextRange> ranges)

public static List<com.sun.star.text.XTextRange>
getDeletedRanges(com.sun.star.text.XTextDocument doc)

The ranges covered by not-yet-accepted deletions.

public static boolean
getRecordChanges(com.sun.star.text.XTextDocument doc)

private static Optional<com.sun.star.text.XTextRange>
private static Optional<com.sun.star.document.XRedlinesSupplier>
getRedlinesSupplier(com.sun.star.text.XTextDocument doc)

private static boolean
private static void
restoreTrackChanges(com.sun.star.text.XTextDocument doc, boolean wasRecording, @Nullable Throwable actionFailure)

public static void
setRecordChanges(com.sun.star.text.XTextDocument doc, boolean recordChanges)

public static void
withRecordChangesSuspended(com.sun.star.text.XTextDocument doc, UnoRedlines.RedlineAction action)

Run action with change recording switched off, then restore the previous setting.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

REDLINE_TYPE_DELETEback to summary
private static final String REDLINE_TYPE_DELETE

Constructor Detail

UnoRedlinesback to summary
public UnoRedlines()

Method Detail

countDeletedRangesTouchingback to summary
public static int countDeletedRangesTouching(com.sun.star.text.XTextDocument doc, List<com.sun.star.text.XTextRange> ranges)
getDeletedRangesback to summary
public static List<com.sun.star.text.XTextRange> getDeletedRanges(com.sun.star.text.XTextDocument doc)

The ranges covered by not-yet-accepted deletions.

getRecordChangesback to summary
public static boolean getRecordChanges(com.sun.star.text.XTextDocument doc) throws com.sun.star.lang.WrappedTargetException
getRedlineRangeback to summary
private static Optional<com.sun.star.text.XTextRange> getRedlineRange(Object redline)
getRedlinesSupplierback to summary
private static Optional<com.sun.star.document.XRedlinesSupplier> getRedlinesSupplier(com.sun.star.text.XTextDocument doc)
isDeleteRedlineback to summary
private static boolean isDeleteRedline(Object redline)
restoreTrackChangesback to summary
private static void restoreTrackChanges(com.sun.star.text.XTextDocument doc, boolean wasRecording, @Nullable Throwable actionFailure) throws com.sun.star.lang.WrappedTargetException, TrackChangesRestoreException
setRecordChangesback to summary
public static void setRecordChanges(com.sun.star.text.XTextDocument doc, boolean recordChanges) throws com.sun.star.lang.WrappedTargetException
withRecordChangesSuspendedback to summary
public static void withRecordChangesSuspended(com.sun.star.text.XTextDocument doc, UnoRedlines.RedlineAction action) throws com.sun.star.lang.WrappedTargetException, TrackChangesRestoreException

Run action with change recording switched off, then restore the previous setting.

Refreshing a citation marker means deleting its old text and writing new text. While recording is on, the delete only marks the old text as deleted, so the old and the new marker end up side by side and the citation appears twice. Suspending recording for the duration of our own edits is what keeps that from happening.

JabRef's own rewrite operations are not recorded as tracked changes.

Todo

Add this warning to user documentation

org.jabref.model.openoffice.uno back to summary

public Interface UnoRedlines.RedlineAction

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
run()

Method Detail

runback to summary
public void run() throws com.sun.star.lang.WrappedTargetException
org.jabref.model.openoffice.uno back to summary

public final Class UnoRedlines.TrackChangesRestoreException

extends Exception
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Constructor Detail

TrackChangesRestoreExceptionback to summary
public TrackChangesRestoreException(Throwable cause)