summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-11-27 15:30:24 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-12-01 03:08:36 +0100
commit297be63c8d1dd8f802b5216048d860c5b2661edc (patch)
tree58368f2d5f1b5e39568cc15f0eb671de46436a95 /sfx2/source
parent71636d5606116e432a69b03d85c4282a6452c7fb (diff)
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.Behrens@CIB.de>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/docfile.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 144fe50aa64c..f232cc0d2ba8 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -173,6 +173,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)
{
@@ -1088,6 +1093,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;
@@ -2866,6 +2875,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