ucb: webdav-curl: fix getting DAV:lockdiscovery property

commit b4576f3da4 "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>
This commit is contained in:
Michael Stahl
2022-04-19 17:34:52 +02:00
parent 441e32d955
commit 68f41f4e2d

View File

@@ -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>
@@ -76,6 +78,7 @@ namespace
{
WebDAVName_unknown = 0,
WebDAVName_activelock,
WebDAVName_lockdiscovery,
WebDAVName_multistatus,
WebDAVName_response,
WebDAVName_href,
@@ -115,6 +118,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));
@@ -752,6 +756,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