LOK: emit modified status on entering cell data

Desktop / LibreOffice - Ashod Nakashian [collabora.co.uk] - 16 December 2019 16:08 EST

Entering data into a cell without committing will normally not set the modified flag. However clients might want to know whether there is in-flight changes when they need to save the document.

A possible scenario is that the user enters some cell data and then closes the window. Both WSD and the client app would here rely on the modified notification to decide whether to save the document or not.

We do not change the document modified state, since that may be incorrect (in case the user actually cancel the cell entry), so we preserve that so future updates to the modified status would reflect the correct state of the file. Instead, we emit a client notification that the document has been modified, to signal them that saving is sensible.

Note that ideally we would undo this when the user cancels the cell edit, but that would be complicated due to multi-editor scenarios. For example, another user might actually edit the document while we cancel our cell edit, and in this case we should not reset the modify flag. Since this is unreliable, we leave the flag set, unless the Core emits an update, which will surely be accurate.

Reviewed-on: https://gerrit.libreoffice.org/75513

d396819ce8c8 LOK: emit modified status on entering cell data
sc/source/ui/view/cellsh3.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)

Upstream: cgit.freedesktop.org


  • Share