[Libreoffice-commits] online.git: loleaflet/dist wsd/ClientSession.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Jun 5 04:52:42 UTC 2017


 loleaflet/dist/toolbar/toolbar.js |   10 +++++++---
 wsd/ClientSession.cpp             |    1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 80b6e9782421223f7abf84f4eb7e4c824804f67f
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>

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 4b97fd61..ea3ab1d2 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -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*/
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 20b50b22..125b24ee 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -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;
             }
         }


More information about the Libreoffice-commits mailing list