summaryrefslogtreecommitdiff
path: root/framework/source/uielement
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/uielement
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/uielement')
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx28
-rw-r--r--framework/source/uielement/uicommanddescription.cxx20
2 files changed, 19 insertions, 29 deletions
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 211c9f9e27b3..9d00ca60d939 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/DockingArea.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/processfactory.hxx>
#include <svtools/imgdef.hxx>
#include <svtools/toolboxcontroller.hxx>
@@ -277,25 +278,14 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
if ( m_xToolbarControllerFactory.is() &&
m_xToolbarControllerFactory->hasController( aURL, m_aModuleIdentifier ))
{
- Sequence< Any > aArgs(5);
- PropertyValue aPropValue;
-
- aPropValue.Name = "ModuleIdentifier";
- aPropValue.Value <<= m_aModuleIdentifier;
- aArgs[0] <<= aPropValue;
- aPropValue.Name = "Frame";
- aPropValue.Value <<= m_xFrame;
- aArgs[1] <<= aPropValue;
- aPropValue.Name = "ServiceManager";
- aPropValue.Value <<= Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW);
- aArgs[2] <<= aPropValue;
- aPropValue.Name = "ParentWindow";
- aPropValue.Value <<= xToolbarWindow;
- aArgs[3] <<= aPropValue;
- aPropValue.Name = "ItemId";
- aPropValue.Value <<= sal_Int32( nId );
- aArgs[4] <<= aPropValue;
-
+ uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence(
+ {
+ {"ModuleIdentifier", uno::Any(m_aModuleIdentifier)},
+ {"Frame", uno::Any(m_xFrame)},
+ {"ServiceManager", uno::Any(Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW))},
+ {"ParentWindow", uno::Any(xToolbarWindow)},
+ {"ItemId", uno::Any(sal_Int32( nId ))}
+ }));
try
{
xController.set( m_xToolbarControllerFactory->createInstanceWithArgumentsAndContext(
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index eed5f5c7230e..5a59fce6e662 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -36,6 +36,7 @@
#include <unotools/configmgr.hxx>
#include <vcl/mnemonic.hxx>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/string.hxx>
@@ -500,15 +501,12 @@ Sequence< OUString > ConfigurationAccess_UICommand::getAllCommands()
void ConfigurationAccess_UICommand::initializeConfigAccess()
{
- Sequence< Any > aArgs( 1 );
- PropertyValue aPropValue;
-
try
{
- aPropValue.Name = "nodepath";
- aPropValue.Value <<= m_aConfigCmdAccess;
- aArgs[0] <<= aPropValue;
-
+ Sequence<Any> aArgs(comphelper::InitAnyPropertySequence(
+ {
+ {"nodepath", Any(m_aConfigCmdAccess)}
+ }));
m_xConfigAccess.set( m_xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess", aArgs ),UNO_QUERY );
if ( m_xConfigAccess.is() )
@@ -522,10 +520,12 @@ void ConfigurationAccess_UICommand::initializeConfigAccess()
}
}
- aPropValue.Value <<= m_aConfigPopupAccess;
- aArgs[0] <<= aPropValue;
+ Sequence<Any> aArgs2(comphelper::InitAnyPropertySequence(
+ {
+ {"nodepath", Any(m_aConfigPopupAccess)}
+ }));
m_xConfigAccessPopups.set( m_xConfigProvider->createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess", aArgs ),UNO_QUERY );
+ "com.sun.star.configuration.ConfigurationAccess", aArgs2 ),UNO_QUERY );
if ( m_xConfigAccessPopups.is() )
{
// Add as container listener