[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp

Pranav Kant pranavk at collabora.co.uk
Thu Feb 1 18:47:27 UTC 2018


 wsd/DocumentBroker.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 28ea409a4570be4edfd57aec8a0c779c5d1bd240
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Feb 1 23:58:43 2018 +0530

    wsd: Don't save if document is unmodified
    
    This also prevents saving the document back to storage.
    
    Without this patch, in case of document conflict (when the document is
    changed behind our back in the storage), the unmodified document end up
    being saved to storage, hence overwriting the document which was changed
    behind our back.
    
    Change-Id: Ie027f5b49c37e7df3f36499e0fef3eca78173969
    Reviewed-on: https://gerrit.libreoffice.org/49114
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index c499b6e4..a985fe36 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -899,7 +899,7 @@ bool DocumentBroker::autoSave(const bool force)
     {
         LOG_TRC("Sending forced save command for [" << _docKey << "].");
         // Don't terminate editing as this can be invoked by the admin OOM, but otherwise force saving anyway.
-        sent = sendUnoSave(savingSessionId, /*dontTerminateEdit=*/ true, /*dontSaveIfUnmodified=*/ false, /*isAutosave=*/ false);
+        sent = sendUnoSave(savingSessionId, /*dontTerminateEdit=*/ true, /*dontSaveIfUnmodified=*/ true, /*isAutosave=*/ false);
     }
     else if (_isModified)
     {


More information about the Libreoffice-commits mailing list