diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-22 16:43:32 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-23 12:07:35 +0100 |
commit | fa54bca695f6d17e871e43db75f06a63aec7b739 (patch) | |
tree | 92b1c6387437eca610802ef325a417b7fe8267ce /ucb | |
parent | e4ff5b1fbabb538356053383a3491e3e986d1164 (diff) |
tdf#145769 ucb: webdav-curl: stop returning IsDocument=true if it doesn't exist
Content::getPropertyValues() has no less than 2 fallbacks that cause it
to return property values IsDocument=true and IsFolder=false in case
there is an authentication failure or server connection failure.
Change-Id: Iddcda6420c517f522d98e58b12a7e19247ff2d1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125667
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-curl/webdavcontent.cxx | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx index eb19e0265659..f74bf01b5125 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx @@ -1339,13 +1339,14 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } } + bool bNetworkAccessAllowed = true; + if ( !m_bTransient && !bHasAll ) { // Obtain values from server... // First, identify whether resource is DAV or not - bool bNetworkAccessAllowed = true; const ResourceType eType = getResourceType( xEnv, xResAccess, &bNetworkAccessAllowed ); @@ -1573,7 +1574,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // For DAV resources we only know the Title, for non-DAV // resources we additionally know that it is a document. - if ( eType == DAV ) + else if ( eType == DAV ) { if (!xProps) xProps.reset(new ContentProperties(aUnescapedTitle)); @@ -1634,21 +1635,24 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( uno::makeAny( aDate ), true ); } - // If WebDAV didn't return the resource type, assume default - // This happens e.g. for lists exported by SharePoint - else if ( (*it) == "IsFolder" ) - { - xProps->addProperty( - (*it), - uno::makeAny( false ), - true ); - } - else if ( (*it) == "IsDocument" ) + else if (bNetworkAccessAllowed) // don't set these if connection failed { - xProps->addProperty( - (*it), - uno::makeAny( true ), - true ); + // If WebDAV didn't return the resource type, assume default + // This happens e.g. for lists exported by SharePoint + if ((*it) == "IsFolder") + { + xProps->addProperty( + (*it), + uno::makeAny( false ), + true ); + } + else if ((*it) == "IsDocument") + { + xProps->addProperty( + (*it), + uno::makeAny( true ), + true ); + } } } } |