summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/source/dialogs/insdlg.cxx14
-rw-r--r--svtools/source/uno/addrtempuno.cxx20
2 files changed, 15 insertions, 19 deletions
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index 9aaa7dbf1871..323075200693 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
using namespace ::com::sun::star;
@@ -104,15 +105,12 @@ void SvObjectServerList::FillInsertObjects()
uno::Reference< lang::XMultiServiceFactory > sProviderMSFactory =
configuration::theDefaultProvider::get(xContext);
- OUString sReaderService( "com.sun.star.configuration.ConfigurationAccess" );
- uno::Sequence< uno::Any > aArguments( 1 );
- beans::PropertyValue aPathProp;
- aPathProp.Name = "nodepath";
- aPathProp.Value <<= OUString( "/org.openoffice.Office.Embedding/ObjectNames" );
- aArguments[0] <<= aPathProp;
-
+ uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
+ {
+ {"nodepath", uno::Any(OUString( "/org.openoffice.Office.Embedding/ObjectNames" ))}
+ }));
uno::Reference< container::XNameAccess > xNameAccess(
- sProviderMSFactory->createInstanceWithArguments( sReaderService,aArguments ),
+ sProviderMSFactory->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArguments ),
uno::UNO_QUERY );
if( xNameAccess.is())
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 5796b06dc7a6..37c6594564e4 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -23,6 +23,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/property.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <rtl/ref.hxx>
@@ -153,17 +154,14 @@ namespace {
{
// convert the parameters for creating the dialog to PropertyValues
- Sequence< Any > aArguments(5);
- Any* pArguments = aArguments.getArray();
- // the parent window
- *pArguments++ <<= PropertyValue( "ParentWindow", -1, makeAny( xParentWindow ), PropertyState_DIRECT_VALUE);
- // the data source to use
- *pArguments++ <<= PropertyValue( "DataSource", -1, makeAny( xDataSource ), PropertyState_DIRECT_VALUE);
- *pArguments++ <<= PropertyValue( "DataSourceName", -1, makeAny( sDataSourceName ), PropertyState_DIRECT_VALUE);
- // the table to use
- *pArguments++ <<= PropertyValue( "Command", -1, makeAny( sCommand ), PropertyState_DIRECT_VALUE);
- // the title
- *pArguments++ <<= PropertyValue( "Title", -1, makeAny( sTitle ), PropertyState_DIRECT_VALUE);
+ Sequence<Any> aArguments(comphelper::InitAnyPropertySequence(
+ {
+ {"ParentWindow", Any(xParentWindow)},
+ {"DataSource", Any(xDataSource)},
+ {"DataSourceName", Any(sDataSourceName)},
+ {"Command", Any(sCommand)}, // the table to use
+ {"Title", Any(sTitle)}
+ }));
OGenericUnoDialog::initialize(aArguments);
return;
}