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 --- stoc/source/javavm/javavm.cxx | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'stoc') diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 0a6105b013cd..4ae249b893c2 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -1301,19 +1302,11 @@ void JavaVirtualMachine::registerConfigChangesListener() { // We register this instance as listener to changes in org.openoffice.Inet/Settings // arguments for ConfigurationAccess - css::uno::Sequence< css::uno::Any > aArguments(2); - aArguments[0] <<= css::beans::PropertyValue( - "nodepath", - 0, - css::uno::makeAny(OUString("org.openoffice.Inet/Settings")), - css::beans::PropertyState_DIRECT_VALUE); - // depth: -1 means unlimited - aArguments[1] <<= css::beans::PropertyValue( - "depth", - 0, - css::uno::makeAny( (sal_Int32)-1), - css::beans::PropertyState_DIRECT_VALUE); - + css::uno::Sequence aArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", css::uno::Any(OUString("org.openoffice.Inet/Settings"))}, + {"depth", css::uno::Any((sal_Int32)-1)} + })); m_xInetConfiguration.set( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", @@ -1324,19 +1317,11 @@ void JavaVirtualMachine::registerConfigChangesListener() m_xInetConfiguration->addContainerListener(this); // now register as listener to changes in org.openoffice.Java/VirtualMachine - css::uno::Sequence< css::uno::Any > aArguments2(2); - aArguments2[0] <<= css::beans::PropertyValue( - "nodepath", - 0, - css::uno::makeAny(OUString("org.openoffice.Office.Java/VirtualMachine")), - css::beans::PropertyState_DIRECT_VALUE); - // depth: -1 means unlimited - aArguments2[1] <<= css::beans::PropertyValue( - "depth", - 0, - css::uno::makeAny( (sal_Int32)-1), - css::beans::PropertyState_DIRECT_VALUE); - + css::uno::Sequence aArguments2(comphelper::InitAnyPropertySequence( + { + {"nodepath", css::uno::Any(OUString("org.openoffice.Office.Java/VirtualMachine"))}, + {"depth", css::uno::Any((sal_Int32)-1)} // depth: -1 means unlimited + })); m_xJavaConfiguration.set( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", -- cgit