diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-25 09:34:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-25 12:03:17 +0200 |
commit | f74da1315a5b2ec232a66944e41ff90231b383be (patch) | |
tree | 60d464c45df3531013642d61cbc8302ac815a1ae /sfx2 | |
parent | 04a6a5d5cdc6889c6f0e41b3df537f59baeee9f9 (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 'sfx2')
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 12 |
4 files changed, 21 insertions, 27 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index d5703887e7ab..516bb5418d3b 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -40,6 +40,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> +#include <comphelper/propertysequence.hxx> #include <toolkit/awt/vclxmenu.hxx> @@ -515,9 +516,10 @@ IMPL_LINK(BackingWindow, ExtLinkClickHdl, Button*, pButton, void) { try { - Sequence<Any> args(1); - PropertyValue val("nodepath", 0, Any(OUString("/org.openoffice.Office.Common/Help/StartCenter")), PropertyState_DIRECT_VALUE); - args.getArray()[0] <<= val; + uno::Sequence<uno::Any> args(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.Common/Help/StartCenter"))} + })); Reference<lang::XMultiServiceFactory> xConfig = configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() ); Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS, args), UNO_QUERY); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 445489490596..165e0e033466 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -26,6 +26,7 @@ #include <rtl/instance.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <sfx2/dockwin.hxx> #include <sfx2/bindings.hxx> @@ -136,18 +137,13 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd , SfxDispatcher* pDispatcher = pBindings->GetDispatcher(); uno::Reference< frame::XFrame > xFrame( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY ); - uno::Sequence< uno::Any > aArgs(2); - beans::PropertyValue aPropValue; - aPropValue.Name = "Frame"; - aPropValue.Value <<= xFrame; - aArgs[0] <<= aPropValue; - aPropValue.Name = "ResourceURL"; - // create a resource URL from the nId provided by the sfx2 - OUString aResourceURL( aDockWindowResourceURL ); - aResourceURL += OUString::number(nId); - aPropValue.Value <<= aResourceURL; - aArgs[1] <<= aPropValue; + OUString aResourceURL = aDockWindowResourceURL + OUString::number(nId); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Frame", uno::Any(xFrame)}, + {"ResourceURL", uno::Any(aResourceURL)}, + })); uno::Reference< awt::XWindow > xWindow; try diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 76973ae9205f..3d39a8074a83 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1747,12 +1747,10 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, uno::Reference< lang::XMultiServiceFactory > xConfigProvider = configuration::theDefaultProvider::get( xContext ); - uno::Sequence< uno::Any > aArgs( 1 ); - beans::PropertyValue aPathProp; - aPathProp.Name = "nodepath"; - aPathProp.Value <<= OUString( "/org.openoffice.Setup/Office/Factories/" ); - aArgs[0] <<= aPathProp; - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString( "/org.openoffice.Setup/Office/Factories/" ))} + })); uno::Reference< container::XNameAccess > xSOFConfig( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index a2e61fd29ad6..f951f000dcf6 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -14,6 +14,7 @@ #include "templatesearchviewitem.hxx" #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/string.hxx> #include <comphelper/storagehelper.hxx> #include <officecfg/Office/Common.hxx> @@ -1071,13 +1072,10 @@ void SfxTemplateManagerDlg::OnTemplateLink () try { Reference<lang::XMultiServiceFactory> xConfig = configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() ); - Sequence<Any> args(1); - PropertyValue val( - "nodepath", - 0, - Any(sNodePath), - PropertyState_DIRECT_VALUE); - args.getArray()[0] <<= val; + uno::Sequence<uno::Any> args(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(sNodePath)} + })); Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args), UNO_QUERY); if( xNameAccess.is() ) { |