summaryrefslogtreecommitdiff
path: root/framework/source/uiconfiguration
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 09:34:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 12:03:17 +0200
commitf74da1315a5b2ec232a66944e41ff90231b383be (patch)
tree60d464c45df3531013642d61cbc8302ac815a1ae /framework/source/uiconfiguration
parent04a6a5d5cdc6889c6f0e41b3df537f59baeee9f9 (diff)
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 <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r--framework/source/uiconfiguration/globalsettings.cxx16
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx19
-rw-r--r--framework/source/uiconfiguration/uicategorydescription.cxx11
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx14
-rw-r--r--framework/source/uiconfiguration/windowstateconfiguration.cxx16
5 files changed, 30 insertions, 46 deletions
diff --git a/framework/source/uiconfiguration/globalsettings.cxx b/framework/source/uiconfiguration/globalsettings.cxx
index 8cc4316d8669..0af47f622d2b 100644
--- a/framework/source/uiconfiguration/globalsettings.cxx
+++ b/framework/source/uiconfiguration/globalsettings.cxx
@@ -31,6 +31,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/instance.hxx>
+#include <comphelper/propertysequence.hxx>
#include <cppuhelper/implbase.hxx>
// Defines
@@ -190,9 +191,6 @@ bool GlobalSettings_Access::GetToolbarStateInfo( GlobalSettings::StateInfo eStat
void GlobalSettings_Access::impl_initConfigAccess()
{
- css::uno::Sequence< css::uno::Any > aArgs( 2 );
- css::beans::PropertyValue aPropValue;
-
try
{
if ( m_xContext.is() )
@@ -200,13 +198,11 @@ void GlobalSettings_Access::impl_initConfigAccess()
css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider =
css::configuration::theDefaultProvider::get( m_xContext );
- aPropValue.Name = "nodepath";
- aPropValue.Value <<= OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars");
- aArgs[0] <<= aPropValue;
- aPropValue.Name = "lazywrite";
- aPropValue.Value <<= true;
- aArgs[1] <<= aPropValue;
-
+ uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence(
+ {
+ {"nodepath", uno::Any(OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars"))},
+ {"lazywrite", uno::Any(true)}
+ }));
m_xConfigAccess.set(xConfigProvider->createInstanceWithArguments(
SERVICENAME_CFGREADACCESS, aArgs ),
css::uno::UNO_QUERY );
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 1bb4119e5387..00c66f75be67 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
@@ -1442,18 +1443,12 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager()
UNO_QUERY );
Reference< XInitialization > xInit( m_xModuleImageManager, UNO_QUERY );
- Sequence< Any > aPropSeq( 3 );
- PropertyValue aPropValue;
- aPropValue.Name = "UserConfigStorage";
- aPropValue.Value <<= m_xUserConfigStorage;
- aPropSeq[0] <<= aPropValue;
- aPropValue.Name = "ModuleIdentifier";
- aPropValue.Value <<= m_aModuleIdentifier;
- aPropSeq[1] <<= aPropValue;
- aPropValue.Name = "UserRootCommit";
- aPropValue.Value <<= m_xUserRootCommit;
- aPropSeq[2] <<= aPropValue;
-
+ uno::Sequence<uno::Any> aPropSeq(comphelper::InitAnyPropertySequence(
+ {
+ {"UserConfigStorage", uno::Any(m_xUserConfigStorage)},
+ {"ModuleIdentifier", uno::Any(m_aModuleIdentifier)},
+ {"UserRootCommit", uno::Any(m_xUserRootCommit)},
+ }));
xInit->initialize( aPropSeq );
}
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx
index 1dcd2681c1e2..119d5282a373 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -37,6 +37,7 @@
#include <unotools/configmgr.hxx>
#include <vcl/mnemonic.hxx>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <unordered_map>
@@ -294,14 +295,12 @@ Sequence< OUString > ConfigurationAccess_UICategory::getAllIds()
void ConfigurationAccess_UICategory::initializeConfigAccess()
{
- Sequence< Any > aArgs( 1 );
- PropertyValue aPropValue;
-
try
{
- aPropValue.Name = "nodepath";
- aPropValue.Value <<= m_aConfigCategoryAccess;
- aArgs[0] <<= aPropValue;
+ Sequence<Any> aArgs(comphelper::InitAnyPropertySequence(
+ {
+ {"nodepath", Any(m_aConfigCategoryAccess)}
+ }));
m_xConfigAccess.set( m_xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess", aArgs ),UNO_QUERY );
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 8419dac29b02..945d0cee0f26 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -47,6 +47,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <vcl/svapp.hxx>
#include <rtl/ref.hxx>
@@ -1139,14 +1140,11 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getImageManager()
UNO_QUERY );
Reference< XInitialization > xInit( m_xImageManager, UNO_QUERY );
- Sequence< Any > aPropSeq( 2 );
- PropertyValue aPropValue;
- aPropValue.Name = "UserConfigStorage";
- aPropValue.Value <<= m_xDocConfigStorage;
- aPropSeq[0] <<= aPropValue;
- aPropValue.Name = "ModuleIdentifier";
- aPropValue.Value <<= m_aModuleIdentifier;
- aPropSeq[1] <<= aPropValue;
+ Sequence<Any> aPropSeq(comphelper::InitAnyPropertySequence(
+ {
+ {"UserConfigStorage", Any(m_xDocConfigStorage)},
+ {"ModuleIdentifier", Any(m_aModuleIdentifier)},
+ }));
xInit->initialize( aPropSeq );
}
diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index 9ce2da62bdf2..3870b0c0cb28 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -40,6 +40,7 @@
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <unordered_map>
@@ -1209,18 +1210,13 @@ void ConfigurationAccess_WindowState::impl_putPropertiesFromStruct( const Window
void ConfigurationAccess_WindowState::impl_initializeConfigAccess()
{
- Sequence< Any > aArgs( 2 );
- PropertyValue aPropValue;
-
try
{
- aPropValue.Name = "nodepath";
- aPropValue.Value <<= m_aConfigWindowAccess;
- aArgs[0] <<= aPropValue;
- aPropValue.Name = "lazywrite";
- aPropValue.Value <<= true;
- aArgs[1] <<= aPropValue;
-
+ Sequence<Any> aArgs(comphelper::InitAnyPropertySequence(
+ {
+ {"nodepath", Any(m_aConfigWindowAccess)},
+ {"lazywrite", Any(true)}
+ }));
m_xConfigAccess.set( m_xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess", aArgs ), UNO_QUERY );
if ( m_xConfigAccess.is() )