diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-28 13:55:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-29 08:57:08 +0200 |
commit | 7cdbde4867b14ae382262dc394ba83e609a8eecf (patch) | |
tree | 5fa180d35a8423a7857b0d57355f74a6d26b5bec /comphelper | |
parent | ab20a5888d3a7f964ef2fb3afe2477825da6037e (diff) |
Initialize Sequence<beans::NamedValue> from initializer_lists
Change-Id: I216dcbd983dcf3df79df9fda371b93114540a9d8
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/mimeconfighelper.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index 361cc00874e0..e6ba4d33d3b0 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -231,9 +231,7 @@ OUString MimeConfigurationHelper::GetDocServiceNameFromMediaType( const OUString try { // make query for all types matching the properties - uno::Sequence < beans::NamedValue > aSeq( 1 ); - aSeq[0].Name = "MediaType"; - aSeq[0].Value <<= aMediaType; + uno::Sequence < beans::NamedValue > aSeq { { "MediaType", css::uno::makeAny(aMediaType) } }; uno::Reference < container::XEnumeration > xEnum = xTypeCFG->createSubSetEnumerationByProperties( aSeq ); while ( xEnum->hasMoreElements() ) @@ -723,11 +721,11 @@ OUString MimeConfigurationHelper::GetDefaultFilterFromServiceName( const OUStrin GetFilterFactory(), uno::UNO_QUERY_THROW ); - uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); - aSearchRequest[0].Name = "DocumentService"; - aSearchRequest[0].Value <<= aServiceName; - aSearchRequest[1].Name = "FileFormatVersion"; - aSearchRequest[1].Value <<= nVersion; + uno::Sequence< beans::NamedValue > aSearchRequest + { + { "DocumentService", css::uno::makeAny(aServiceName) }, + { "FileFormatVersion", css::uno::makeAny(nVersion) } + }; uno::Reference< container::XEnumeration > xFilterEnum = xFilterQuery->createSubSetEnumerationByProperties( aSearchRequest ); @@ -805,11 +803,11 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin OSL_ENSURE( !aDocumentServiceName.isEmpty() && !aTypeName.isEmpty(), "Incomplete filter data!" ); if ( !(aDocumentServiceName.isEmpty() || aTypeName.isEmpty()) ) { - uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); - aSearchRequest[0].Name = "Type"; - aSearchRequest[0].Value <<= aTypeName; - aSearchRequest[1].Name = "DocumentService"; - aSearchRequest[1].Value <<= aDocumentServiceName; + uno::Sequence< beans::NamedValue > aSearchRequest + { + { "Type", css::uno::makeAny(aTypeName) }, + { "DocumentService", css::uno::makeAny(aDocumentServiceName) } + }; uno::Sequence< beans::PropertyValue > aExportFilterProps = SearchForFilter( uno::Reference< container::XContainerQuery >( xFilterFactory, uno::UNO_QUERY_THROW ), |