officecfg/registry/schema/org/openoffice/Office/Common.xcs |    9 +++++++
 sfx2/source/doc/docfile.cxx                                |   15 +++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit 10dbbe46a4818b0fea4afbfe0fd66f75a2dd8eef
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Tue Nov 27 15:30:24 2018 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Sat Dec 1 03:17:28 2018 +0100

    Option to turn off WebDAV file locking
    
    Locking files on WebDAV shares was implemented in tdf#82744,
    in particular:
    
    commit 26e6d4b05ab444e6a7529ffcac7fbe592fc94833
        tdf#82744: fix WebDAV lock/unlock behaviour - part 1
    commit bc9a8ddbb7081f79e915c841e56fd1c40f0df6f9
        tdf#82744: fix WebDAV lock/unlock behaviour - part 2
    commit b4576f3da4d90139fc5140962d13cb91dab98797
        tdf#82744: fix WebDAV lock/unlock behaviour - part 3
    commit fed2984281a85a5a2f308841ec810f218c75f2ab
        tdf#82744: fix WebDAV lock/unlock behaviour - part 4
    
    Before that, files on WebDAV shares were accessed w/o locking since
    the beginning of [OOo] time. This option allows to revert to
    the old behaviour i.e. non-locking WebDAV access.
    
    For concurrent read-write WebDAV access by multiple users it is
    recommended to keep UseWebDAVFileLocking at default value (true)
    
    Change-Id: Id92177631d4854d6c7bf412164acbd9740db9592
    Reviewed-on: https://gerrit.libreoffice.org/64116
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit 297be63c8d1dd8f802b5216048d860c5b2661edc)
    Reviewed-on: https://gerrit.libreoffice.org/64371
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 3d73cc94deb2..432958100279 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5333,6 +5333,15 @@
         </info>
         <value>true</value>
       </prop>
+      <prop oor:name="UseWebDAVFileLocking" oor:type="xs:boolean" 
oor:nillable="false">
+        <info>
+          <desc>Determines if WebDAV-specific file locking is used for 
documents
+         on WebDAV shares. It is not recommended to set this option to 'false' 
in
+         scenarios where multi-user, concurrent read/write access to WebDAV 
share
+         is required</desc>
+        </info>
+        <value>true</value>
+      </prop>
       <prop oor:name="UseDocumentOOoLockFile" oor:type="xs:boolean" 
oor:nillable="false">
         <info>
           <desc>Allows to specify whether the OOo document file locking
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 11d6fc293301..9212fabfeb6b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -171,6 +171,11 @@ bool IsLockingUsed()
 
 #endif
 
+bool IsWebDAVLockingUsed()
+{
+    return officecfg::Office::Common::Misc::UseWebDAVFileLocking::get();
+}
+
 /// Gets default attributes of a file:// URL.
 sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
 {
@@ -1103,6 +1108,10 @@ SfxMedium::LockFileResult 
SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
 
     if ( GetURLObject().isAnyKnownWebDAVScheme() )
     {
+        // do nothing if WebDAV locking is disabled
+        if (!IsWebDAVLockingUsed())
+            return LockFileResult::Succeeded;
+
         try
         {
             bool bResult = pImpl->m_bLocked;
@@ -2895,6 +2904,12 @@ void SfxMedium::UnlockFile( bool bReleaseLockStream )
     // check if webdav
     if ( GetURLObject().isAnyKnownWebDAVScheme() )
     {
+        // do nothing if WebDAV locking if disabled
+        // (shouldn't happen because we already skipped locking,
+        // see LockOrigFileOnDemand, but just in case ...)
+        if (!IsWebDAVLockingUsed())
+            return;
+
         if ( pImpl->m_bLocked )
         {
             // an interaction handler should be used for authentication, if 
needed
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to