diff options
author | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-10-21 15:53:53 +0200 |
---|---|---|
committer | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-10-21 17:49:03 +0000 |
commit | bb27b2ff87e534b6f4fb9583271db29d6bbae8b6 (patch) | |
tree | 91d23a417ccff1cca607f002ae36f28ceda8ce6f | |
parent | 8dcad50137bdcfd1fd1ef444b3397bdec1d5417a (diff) |
tdf#102499 (8): Return empty property when not present.
Change-Id: If5afa4f33ac5b5dfec123960c2e9660183576256
Reviewed-on: https://gerrit.libreoffice.org/30142
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 53d27a7d67c3..00ccdb9cb0ed 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -1745,6 +1745,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 ) { |