ddn.odf.tracking
ODF 1.3 change-tracking model for text and spreadsheet documents.
Implements typed parsing and serialisation of tracked changes as defined in OpenDocument v1.3 Part 3 Section 5.4 (Text Change Tracking) and Section 8.4 (Spreadsheet Change Tracking).
Supports:
- Text tracked changes:
text:tracked-changes,text:changed-region,text:insertion,text:deletion,text:format-change - Spreadsheet tracked changes:
table:tracked-changes,table:cell-content-changewith previous and new cell values - Round-trip serialisation preserving author, timestamp, and raw XML
- Accept/reject operations on tracking metadata for both text and spreadsheet changes
Note
Accept and reject operations remove tracking metadata only. They do not mutate document body content (applying insertions, reverting deletions, or restoring format changes).
Types 7
Identifies the kind of a tracked change operation.
Maps to ODF change-tracking child elements: text:insertion, text:deletion, text:format-change and table:insertion, table:deletion, table:cell-content-change.
Represents a single text:changed-region element in a text document.
Each region captures an insertion, deletion, or format-change made by an author at a specific point in time. The id is used by text:change, text:change-start, and text:change-end inline markers to delimit the affected content.
Represents an inline change marker (text:change, text:change-start, or text:change-end).
The changeId references an OdfTextChangeRegion.id in the document's text:tracked-changes section.
string changeIdContains all tracked changes for a text document body.
Parsed from a text:tracked-changes element inside office:text.
OdfTextChangeRegion[] regionsRepresents a single table:cell-content-change element in a spreadsheet document.
Captures the author, timestamp, previous cell value, and new cell value for a tracked cell edit.
string idOdfChangeType changeTypestring authorstring timestampstring oldValuestring newValueXmlElement rawXmlContains all tracked changes for a single spreadsheet sheet.
Parsed from a table:tracked-changes element inside table:table.
OdfCellChange[] changesTop-level container for all tracked changes across text and spreadsheet bodies.
Functions 19
OdfTextTrackedChanges parseTextTrackedChanges(XmlElement body)Parses `text:tracked-changes` from a text body element.OdfSheetChange parseSheetTrackedChanges(XmlElement sheetElem)Parses `table:tracked-changes` from a sheet element.OdfSheetChange parseSheetTrackedChangesFromContainer(
XmlElement trackedChangesElem)Parses cell changes from a `table:tracked-changes` container element.OdfTextChangeRegion[] parseChangedRegions(XmlElement trackedChangesElem)Iterates over the children of trackedChangesElem and extracts each `text:changed-region` with its id, change type, author, and timestamp.string serializeTextTrackedChanges(const ref OdfTextTrackedChanges changes)Serialises text tracked changes back to an XML string.string serializeSheetTrackedChanges(const ref OdfSheetChange changes)Serialises spreadsheet tracked changes back to an XML string.OdfTextTrackedChanges acceptTextChanges(ref OdfTextTrackedChanges changes,
string[] changeIds)Accepts the specified text tracked changes by removing their change regions.OdfTextTrackedChanges acceptAllTextChanges(
ref OdfTextTrackedChanges changes)Accepts all text tracked changes by clearing all change regions.OdfTextTrackedChanges rejectTextChanges(ref OdfTextTrackedChanges changes,
string[] changeIds)Rejects the specified text tracked changes by removing their change regions.OdfTextTrackedChanges rejectAllTextChanges(
ref OdfTextTrackedChanges changes)Rejects all text tracked changes by clearing all change regions.OdfSheetChange acceptSheetChanges(ref OdfSheetChange changes,
string[] changeIds)Accepts the specified sheet tracked changes by removing their cell changes.OdfSheetChange acceptAllSheetChanges(ref OdfSheetChange changes)Accepts all sheet tracked changes by clearing all cell changes.OdfSheetChange rejectSheetChanges(ref OdfSheetChange changes,
string[] changeIds)Rejects the specified sheet tracked changes.OdfSheetChange rejectAllSheetChanges(ref OdfSheetChange changes)Rejects all sheet tracked changes.bool hasTrackedChanges(const ref OdfTextTrackedChanges changes)Returns true if any text change regions exist.bool hasTrackedChanges(const ref OdfSheetChange changes)Returns true if any sheet cell changes exist.