Set EverModified on saving the document

When saving while editing a cell, the
document is saved with the new cell contents
(as the cell editing is interrupted and applied),
but the modified status is not published to the
client (loleaflet).

This has the unfortunate side-effect that the
EverModified flag is not set in this scenario.

To avoid this, this patch sets the EverModified
upon successful saving. This is easier than
forcing LO Core to emit ModifiedStatus=true
in the scenario above. Though it suffers from
the false-positive result when the user forces
a save. Although this is probably defensible,
since technically the document changes upon
saving (though not the content if there was
nothing new to save). On the other hand,
it's less harmful to signal modification
due to save than to ignore genuine
modification to the document.

Change-Id: I7ccba62731f534b69819f7924eeb9231d874c111
Reviewed-on: https://gerrit.libreoffice.org/38398
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian 2017-06-04 23:40:18 -04:00 committed by Ashod Nakashian
parent eeaf436d53
commit 80b6e97824
2 changed files with 8 additions and 3 deletions

View file

@ -1421,10 +1421,14 @@ map.on('commandresult', function (e) {
var commandName = e.commandName;
if (commandName === '.uno:Save' && e.success === true) {
// Saved a new version; the document is modified.
map._everModified = true;
// owncloud integration
if (typeof window.parent.documentsMain !== 'undefined') {
window.parent.documentsMain.saveDocumentBack();
}
//FIXME: CSP Violation.
//if (typeof window.parent.documentsMain !== 'undefined') {
// window.parent.documentsMain.saveDocumentBack();
// }
}
else if ((commandName === '.uno:Undo' || commandName === '.uno:Redo') &&
e.success === true && e.result.value && !isNaN(e.result.value)) { /*UNDO_CONFLICT*/

View file

@ -561,6 +561,7 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
// Save to Storage and log result.
std::string id = getId();
docBroker->saveToStorage(id, success, result);
forwardToClient(payload);
return true;
}
}