ucb/source/ucp/webdav-curl/webdavcontent.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
New commits: commit 3665527ea9f003830eb47ecd221a950c35caf731 Author: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> AuthorDate: Fri Oct 21 15:53:53 2016 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 1 18:53:17 2021 +0100 ucb: webdav-curl: tdf#102499 (8): Return empty property when not present. [ port of commit bb27b2ff87e534b6f4fb9583271db29d6bbae8b6 ] Change-Id: I3375aff7e3b82bb41917b1d87432fd48af41a05c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123501 Tested-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx index 01bc742f0e25..b2d645bc1f23 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx @@ -1621,6 +1621,30 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( m_bCollection ) ); } + // Add a default for the properties requested but not found. + // Determine still missing properties, add a default. + // Some client function doesn't expect a void uno::Any, + // but instead wants some sort of default. + std::vector< OUString > aMissingProps; + if ( !xProps->containsAllNames( + rProperties, aMissingProps ) ) + { + // + for ( std::vector< rtl::OUString >::const_iterator it = aMissingProps.begin(); + it != aMissingProps.end(); ++it ) + { + // For the time being only a couple of properties need to be added + if ( (*it) == "DateModified" || (*it) == "DateCreated" ) + { + util::DateTime aDate; + xProps->addProperty( + (*it), + uno::makeAny( aDate ), + true ); + } + } + } + sal_Int32 nCount = rProperties.getLength(); for ( sal_Int32 n = 0; n < nCount; ++n ) {