Estimated read time: 3 minutes
Writer has the concept of rejecting tracked changes: if a proposed insertion or deletion is not wanted, then one can reject it to push back on the proposal. So far such an action left no trace in the document, which is sometimes not wanted. Calling reinstate on a change behaves like reject, but with history: it reinstates the original state, with the rejected change preserved in the document.
This work is primarily for Collabora Online, but the feature is available in desktop Writer as well.
Motivation¶
When Alice works on a document to insert e.g. new conditions for a contract, then perhaps Bob is not happy with the proposal. But just rejecting the change "silently" would not be polite: the tracked change then disappears, so possibly Alice thinks it was accepted and Bob didn't communicate the pushback explicitly in the resulting document, either.
Reinstate is meant to improve this interaction: if an insert is reinstated, then an explicit delete is created on top of the insert, so Alice can see that Bob was not happy with the proposal. Or in case Alice proposed a delete, Bob can reinstate that by adding the same content again to the document, without typing the text manually after the delete.
This is a UI feature: the resulting model still only contains inserts and deletes, so it works even with DOCX files.
Results so far¶
Given an insert:
Now you can easily create a delete on top of the insert:
And given a delete:
Now you can easily create an insert right after the delete, preserving complex content:
As you can see, this creates the opposite of the original change as a new tracked change, so it will in the end still reject the change, but without deleting the original change.
How is this implemented?¶
If you would like to know a bit more about how this works, continue reading... :-)
As usual, the high-level problem was addressed by a series of small changes. Core side:
- cool#11357 sw redline reinstate: implement this for a single insert
- cool#11357 sw redline reinstate: handle inserts in selection
- cool#11357 sw redline reinstate: handle a single delete
- cool#11357 sw redline reinstate: handle a single rich delete
- cool#11357 sw redline reinstate: handle deletes in selection
- cool#11357 sw redline reinstate: simplify ReinstateRedlinesInSelection()
- cool#11357 sw redline reinstate: add command state
- cool#11357 sw redline reinstate: add a reinstate-and-next command
- cool#11357 sw redline reinstate: add a reinstate-all command
- cool#11357 sw redline reinstate: avoid unwanted multi- or table selection
- cool#11357 sw redline reinstate: fix undo string for a single redline
- cool#11357 sw redline reinstate: fix undo count & string for multiple redlines
- cool#11357 sw redline reinstate: add to the context menu for text
Online side:
Want to start using this?¶
You can get a development edition of Collabora Online 25.04 and try it out yourself right now: try the development edition. Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be available in TDF's next release too (25.8).