wsd/DocumentBroker.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 35f8788e1cae3d94ae9a39074aca83dddaea43d3
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Jul 1 13:38:06 2020 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Jul 2 14:21:30 2020 +0200

    Only lock documents in editing sessions
    
    Change-Id: I97753541a944bb299b04c032790d6af7a9ee0f63
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97609
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 7753d87ac..e64c0f8e1 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -786,7 +786,9 @@ bool DocumentBroker::load(const 
std::shared_ptr<ClientSession>& session, const s
         std::string localPath = _storage->loadStorageFileToLocal(
             session->getAuthorization(), session->getCookies(), *_lockCtx, 
templateSource);
 
-        if (!_storage->updateLockState(session->getAuthorization(), 
session->getCookies(), *_lockCtx, true))
+        // Only lock the document on storage for editing sessions
+        if (!session->isReadOnly() &&
+            !_storage->updateLockState(session->getAuthorization(), 
session->getCookies(), *_lockCtx, true))
             LOG_ERR("Failed to lock!");
 
 #if !MOBILEAPP
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to