ucb/source/ucp/webdav-neon/webdavcontent.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
New commits: commit bb27b2ff87e534b6f4fb9583271db29d6bbae8b6 Author: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> Date: Fri Oct 21 15:53:53 2016 +0200 tdf#102499 (8): Return empty property when not present. Change-Id: If5afa4f33ac5b5dfec123960c2e9660183576256 Reviewed-on: https://gerrit.libreoffice.org/30142 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 53d27a7..00ccdb9 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 ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits