summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-10-21 15:53:53 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:53:17 +0100
commit3665527ea9f003830eb47ecd221a950c35caf731 (patch)
tree6be50b85d822c8f416e997719afda77b3d6bda5a /ucb
parent09e159ba18989f8b5720205f0bdebdb277c5d067 (diff)
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.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx24
1 files changed, 24 insertions, 0 deletions
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 )
{