summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2015-08-28 18:52:36 +0200
committerJan Holesovsky <kendy@collabora.com>2015-10-05 11:14:50 +0000
commitb4576f3da4d90139fc5140962d13cb91dab98797 (patch)
tree12f4d4a16e0c6d5d9c9995315da37b96c6629a87 /ucbhelper
parent8ea85c264f22c76d393c0f78e9db7df51e2c868d (diff)
tdf#82744: fix WebDAV lock/unlock behaviour - part 3
Changes done to the code in sfx2, ucbhelper, ucb, unotools in no particular order - add method helpers to call the ucb lock/unlock - add lock/unlock 'real' management - make DateChange property retrieval working for WebDAV as well - add check for changed content of a WebDAV file, in order to reload it correctly when 'Edit Mode' command is activated from GUI - Unlock WebDAV file while saving only if explicitly enabled Needed in order to avoid the small window of file unlocked state that opens while saving a file. When saving LO actually does as follows: - unlock the prevoius version of the file - prepares operations to save the modified version - lock the new file - save the new version - the lock method is enabled if the DAV resource supports it. In case the lock is not supported, for example example DAV with lock disabled, the lock method is disabled. Exception: when the resource is first created and the lock is not supported: a lock command is sent anyway, because if the resource is not yet present, there is no method to detect the lock/unlock availability in this case. - cppcheck:noExplicitConstructor Change-Id: I0aa876c4e3364d86e5740977b97f3db9a01e4491 Reviewed-on: https://gerrit.libreoffice.org/17189 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/source/client/content.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx
index 8edaa5a1cd6a..3ee7688646a9 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -1096,7 +1096,28 @@ bool Content::isDocument()
SAL_WNOUNREACHABLE_CODE_POP
+void Content::lock()
+ throw( CommandAbortedException, RuntimeException, Exception )
+{
+ Command aCommand;
+ aCommand.Name = rtl::OUString::createFromAscii( "lock" );
+ aCommand.Handle = -1; // n/a
+ m_xImpl->executeCommand( aCommand );
+
+}
+
+void Content::unlock()
+ throw( CommandAbortedException, RuntimeException, Exception )
+{
+
+ Command aCommand;
+ aCommand.Name = rtl::OUString::createFromAscii( "unlock" );
+ aCommand.Handle = -1; // n/a
+
+ m_xImpl->executeCommand( aCommand );
+
+}
// Content_Impl Implementation.