diff options
Diffstat (limited to 'dbaccess/source/filter/xml')
-rw-r--r-- | dbaccess/source/filter/xml/dbloader2.cxx | 28 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlComponent.cxx | 22 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlHierarchyCollection.cxx | 17 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlTable.cxx | 16 |
4 files changed, 29 insertions, 54 deletions
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index a20c299e8caf..5f8d2d07fbcc 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -58,6 +58,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/types.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <osl/file.hxx> @@ -338,18 +339,11 @@ namespace bool DBContentLoader::impl_executeNewDatabaseWizard( Reference< XModel >& _rxModel, bool& _bShouldStartTableWizard ) { - Sequence< Any > aWizardArgs(2); - aWizardArgs[0] <<= PropertyValue( - "ParentWindow", - 0, - makeAny( lcl_getTopMostWindow( m_aContext ) ), - PropertyState_DIRECT_VALUE); - - aWizardArgs[1] <<= PropertyValue( - "InitialSelection", - 0, - makeAny( _rxModel ), - PropertyState_DIRECT_VALUE); + Sequence<Any> aWizardArgs(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", Any(lcl_getTopMostWindow( m_aContext ))}, + {"InitialSelection", Any(_rxModel)} + })); // create the dialog Reference< XExecutableDialog > xAdminDialog( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.sdb.DatabaseWizardDialog", aWizardArgs, m_aContext), UNO_QUERY_THROW); @@ -559,12 +553,10 @@ IMPL_LINK_NOARG( DBContentLoader, OnStartTableWizard, void*, void ) m_nStartWizard = nullptr; try { - Sequence< Any > aWizArgs(1); - PropertyValue aValue; - aValue.Name = "DatabaseLocation"; - aValue.Value <<= m_sCurrentURL; - aWizArgs[0] <<= aValue; - + Sequence<Any> aWizArgs(comphelper::InitAnyPropertySequence( + { + {"DatabaseLocation", Any(m_sCurrentURL)} + })); SolarMutexGuard aGuard; Reference< XJobExecutor > xTableWizard( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.wizards.table.CallTableWizard", aWizArgs, m_aContext), UNO_QUERY); if ( xTableWizard.is() ) diff --git a/dbaccess/source/filter/xml/xmlComponent.cxx b/dbaccess/source/filter/xml/xmlComponent.cxx index f1ceb62e3797..538b55bed691 100644 --- a/dbaccess/source/filter/xml/xmlComponent.cxx +++ b/dbaccess/source/filter/xml/xmlComponent.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <comphelper/propertysequence.hxx> namespace dbaxml { @@ -80,22 +81,13 @@ OXMLComponent::OXMLComponent( ODBFilter& rImport } if ( !m_sHREF.isEmpty() && !m_sName.isEmpty() && _xParentContainer.is() ) { - Sequence< Any > aArguments(3); - PropertyValue aValue; - // set as folder - aValue.Name = PROPERTY_NAME; - aValue.Value <<= m_sName; - aArguments[0] <<= aValue; - - aValue.Name = PROPERTY_PERSISTENT_NAME; sal_Int32 nIndex = m_sHREF.lastIndexOf('/')+1; - aValue.Value <<= m_sHREF.getToken(0,'/',nIndex); - aArguments[1] <<= aValue; - - aValue.Name = PROPERTY_AS_TEMPLATE; - aValue.Value <<= m_bAsTemplate; - aArguments[2] <<= aValue; - + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {PROPERTY_NAME, Any(m_sName)}, // set as folder + {PROPERTY_PERSISTENT_NAME, Any(m_sHREF.getToken(0,'/',nIndex))}, + {PROPERTY_AS_TEMPLATE, Any(m_bAsTemplate)}, + })); try { Reference< XMultiServiceFactory > xORB( _xParentContainer, UNO_QUERY_THROW ); diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx index d7a10a735814..9d82f99b5622 100644 --- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx +++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx @@ -29,6 +29,7 @@ #include "stringconstants.hxx" #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <comphelper/propertysequence.hxx> namespace dbaxml { @@ -71,20 +72,14 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport { try { - Sequence< Any > aArguments(2); - PropertyValue aValue; - // set as folder - aValue.Name = "Name"; - aValue.Value <<= m_sName; - aArguments[0] <<= aValue; - //parent - aValue.Name = "Parent"; - aValue.Value <<= _xParentContainer; - aArguments[1] <<= aValue; - Reference<XMultiServiceFactory> xORB(_xParentContainer,UNO_QUERY); if ( xORB.is() ) { + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"Name", Any(m_sName)}, // set as folder + {"Parent", Any(_xParentContainer)}, + })); m_xContainer.set(xORB->createInstanceWithArguments(_sCollectionServiceName,aArguments),UNO_QUERY); Reference<XNameContainer> xNameContainer(_xParentContainer,UNO_QUERY); if ( xNameContainer.is() && !xNameContainer->hasByName(m_sName) ) diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx index ceb86414d249..b6ca98b0d84a 100644 --- a/dbaccess/source/filter/xml/xmlTable.cxx +++ b/dbaccess/source/filter/xml/xmlTable.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <comphelper/namecontainer.hxx> +#include <comphelper/propertysequence.hxx> namespace dbaxml { @@ -87,16 +88,11 @@ OXMLTable::OXMLTable( ODBFilter& _rImport break; } } - Sequence< Any > aArguments(2); - PropertyValue aValue; - // set as folder - aValue.Name = "Name"; - aValue.Value <<= m_sName; - aArguments[0] <<= aValue; - //parent - aValue.Name = "Parent"; - aValue.Value <<= m_xParentContainer; - aArguments[1] <<= aValue; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"Name", uno::Any(m_sName)}, // set as folder + {"Parent", uno::Any(m_xParentContainer)} + })); m_xTable.set( GetOwnImport().GetComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext(m_sServiceName,aArguments, GetOwnImport().GetComponentContext()), UNO_QUERY); |