From 48f45d36e2a0e9fbaaa4bd55e8ee4acaa9499072 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Mar 2013 14:32:00 +0200 Subject: Lock document that is opened for potential modification Part of fix for bnc#805901. (No locking of documents edited through WebDAV.) Seems to work, can it really be this simple... I am a bit unsure if any explicit UNLOCK operation happens, but WebDAV locks typically time out relatively quickly, don't they? And WebDAV implementations (often/always?) have the possibility for a user to force open a lock. Change-Id: Ia32d8b1517361f702b4f469d9f1aa17de6d7ba54 --- ucb/source/ucp/webdav-neon/webdavcontent.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 14d52d3d006c..6a3cb7b2d6cc 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -499,6 +499,11 @@ uno::Any SAL_CALL Content::execute( } aRet = open( aOpenCommand, Environment ); + + if ( (aOpenCommand.Mode == ucb::OpenMode::DOCUMENT || + aOpenCommand.Mode == ucb::OpenMode::DOCUMENT_SHARE_DENY_WRITE) && + supportsExclusiveWriteLock( Environment ) ) + lock( Environment ); } else if ( aCommand.Name == "insert" ) { -- cgit