[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/dist wsd/ClientSession.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Tue Jun 6 10:35:44 UTC 2017
loleaflet/dist/toolbar/toolbar.js | 10 +++++++---
wsd/ClientSession.cpp | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 5bdc1e273f43faa892de8e9f25f6a330c9613525
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Jun 4 23:40:18 2017 -0400
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 at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 80b6e9782421223f7abf84f4eb7e4c824804f67f)
Reviewed-on: https://gerrit.libreoffice.org/38399
Reviewed-by: pranavk <pranavk at collabora.co.uk>
Tested-by: pranavk <pranavk at collabora.co.uk>
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index a035ba3e..060c4562 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1406,10 +1406,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*/
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index a65959b8..ed15e8c1 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -542,6 +542,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;
}
}
More information about the Libreoffice-commits
mailing list