From f74da1315a5b2ec232a66944e41ff90231b383be Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 25 Jul 2017 09:34:01 +0200 Subject: use more comphelper::InitAnyPropertySequence Found with: git grep -n -A10 'Sequence.*Any' -- *.cxx | grep -B5 -w PropertyValueProvider and: git grep -n 'Sequence.*Any.*( *&' Change-Id: Icb18c98bdd3f8352817e443ff78de5df042859ad Reviewed-on: https://gerrit.libreoffice.org/40389 Tested-by: Jenkins Reviewed-by: Noel Grandin --- desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 22 +++++++++++----------- .../deployment/misc/dp_descriptioninfoset.cxx | 11 +++++------ 2 files changed, 16 insertions(+), 17 deletions(-) (limited to 'desktop') diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index ebbad45dd4e3..fa8724c84ccb 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include "dp_gui_dialog2.hxx" #include "dp_gui_extensioncmdqueue.hxx" @@ -64,23 +65,22 @@ TheExtensionManager::TheExtensionManager( const uno::Reference< awt::XWindow > & uno::Reference< lang::XMultiServiceFactory > xConfig( configuration::theDefaultProvider::get(xContext)); - uno::Any args[1]; - beans::PropertyValue aValue( "nodepath", 0, uno::Any( OUString("/org.openoffice.Office.OptionsDialog/Nodes") ), - beans::PropertyState_DIRECT_VALUE ); - args[0] <<= aValue; + uno::Sequence args(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.OptionsDialog/Nodes"))} + })); m_xNameAccessNodes.set( - xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - uno::Sequence< uno::Any >( args, 1 )), + xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args), uno::UNO_QUERY_THROW); // get the 'get more extensions here' url + uno::Sequence args2(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.ExtensionManager/ExtensionRepositories"))} + })); uno::Reference< container::XNameAccess > xNameAccessRepositories; - beans::PropertyValue aValue2( "nodepath", 0, uno::Any( OUString("/org.openoffice.Office.ExtensionManager/ExtensionRepositories") ), - beans::PropertyState_DIRECT_VALUE ); - args[0] <<= aValue2; xNameAccessRepositories.set( - xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - uno::Sequence< uno::Any >( args, 1 )), + xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args2), uno::UNO_QUERY_THROW); try { //throws css::container::NoSuchElementException, css::lang::WrappedTargetException diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index b1762ab7fd87..3acd182a8ed8 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -350,12 +351,10 @@ void DescriptionInfoset::checkBlacklist() const if (currentversion.getLength() == 0) return; // nothing to check - css::uno::Sequence< css::uno::Any > args = css::uno::Sequence< css::uno::Any >(1); - css::beans::PropertyValue prop; - prop.Name = "nodepath"; - prop.Value <<= OUString("/org.openoffice.Office.ExtensionDependencies/Extensions"); - args[0] <<= prop; - + css::uno::Sequence args(comphelper::InitAnyPropertySequence( + { + {"nodepath", css::uno::Any(OUString("/org.openoffice.Office.ExtensionDependencies/Extensions"))} + })); css::uno::Reference< css::container::XNameAccess > blacklist( (css::configuration::theDefaultProvider::get(m_context) ->createInstanceWithArguments( -- cgit