summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-19 17:34:52 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-04-22 15:49:25 +0200
commite84852e4ac0b3e6b72cc8ad7b3b95f3e73eac592 (patch)
tree0d434d106c9397436e43d6e1ec3fc152b8829c9c
parent9d68e53b368ffebf20821702ac15dd974ab2eac6 (diff)
ucb: webdav-curl: fix getting DAV:lockdiscovery property
commit b4576f3da4d90139fc5140962d13cb91dab98797 "tdf#82744: fix WebDAV lock/unlock behaviour - part 3" added a call to get the DAV:lockdiscovery property. But WebDAVResponseParser puts lock related properties into a separate return value maResult_Lock that is only returned for LOCK requests. Just add it as a normal property too, then PROPFIND can get it, and the dialog in SfxMedium::LockOrigFileOnDemand() no longer displays "Unknown user". Change-Id: Icee920588ea40b6e203b18287d75484528cfdebb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133185 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 68f41f4e2dcec65e8885cdfa658c0568a26182a9)
-rw-r--r--ucb/source/ucp/webdav-curl/webdavresponseparser.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
index 33074b94040e..6d7902a2f9c3 100644
--- a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
@@ -22,11 +22,13 @@
#include "DAVProperties.hxx"
#include "UCBDeadPropertyValue.hxx"
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
+
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <comphelper/processfactory.hxx>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/ucb/LockEntry.hpp>
#include <com/sun/star/ucb/LockScope.hpp>
#include <com/sun/star/ucb/LockType.hpp>
@@ -75,6 +77,7 @@ namespace
{
WebDAVName_unknown = 0,
WebDAVName_activelock,
+ WebDAVName_lockdiscovery,
WebDAVName_multistatus,
WebDAVName_response,
WebDAVName_href,
@@ -114,6 +117,7 @@ namespace
if(aWebDAVNameMapperList.empty())
{
aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("activelock"), WebDAVName_activelock));
+ aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("lockdiscovery"), WebDAVName_lockdiscovery));
aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("multistatus"), WebDAVName_multistatus));
aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("response"), WebDAVName_response));
aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("href"), WebDAVName_href));
@@ -751,6 +755,20 @@ namespace
maResult_Lock.push_back(maLock);
break;
}
+ case WebDAVName_lockdiscovery:
+ {
+ // lockdiscovery may be requested via PROPFIND,
+ // in addition to LOCK! so return it 2 ways
+ if (isCollectingProperties())
+ {
+ http_dav_ucp::DAVPropertyValue aDAVPropertyValue;
+
+ aDAVPropertyValue.Name = "DAV:lockdiscovery";
+ aDAVPropertyValue.Value <<= ::comphelper::containerToSequence(maResult_Lock);
+ maPropStatProperties.push_back(aDAVPropertyValue);
+ }
+ break;
+ }
case WebDAVName_propstat:
{
// propstat end, check status