summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/docfile.cxx')
-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