summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-19 17:34:52 +0200
committerAndras Timar <andras.timar@collabora.com>2022-04-25 11:13:35 +0200
commit17de89f167a26d8d1cb560f61e92b5aef7ef3fb7 (patch)
tree82a7514004b41b7ed339d91e6d17247e3c2781c3 /ucb
parent89c2dfcbb749b9b8d9d6e29e92b0d1086f2abf1d (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) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133142 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'ucb')
-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 a236957c096e..8b7d0473585c 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