diff options
62 files changed, 661 insertions, 1004 deletions
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index d8eb242b5061..535f09c63727 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/implementationentry.hxx> @@ -132,28 +133,24 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) : Reference<lang::XMultiServiceFactory> xConfigProvider( configuration::theDefaultProvider::get( m_xContext ) ); - Any propValue( - Any( beans::PropertyValue( - "nodepath", -1, - Any( OUString("/org.openoffice.Office.Canvas") ), - beans::PropertyState_DIRECT_VALUE ) ) ); - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.Canvas"))} + })); m_xCanvasConfigNameAccess.set( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - Sequence<Any>( &propValue, 1 ) ), + aArgs ), UNO_QUERY_THROW ); - propValue <<= - beans::PropertyValue( - "nodepath", -1, - Any( OUString("/org.openoffice.Office.Canvas/CanvasServiceList") ), - beans::PropertyState_DIRECT_VALUE ); - + uno::Sequence<uno::Any> aArgs2(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.Canvas/CanvasServiceList"))} + })); Reference<container::XNameAccess> xNameAccess( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - Sequence<Any>( &propValue, 1 ) ), UNO_QUERY_THROW ); + aArgs2 ), UNO_QUERY_THROW ); Reference<container::XHierarchicalNameAccess> xHierarchicalNameAccess( xNameAccess, UNO_QUERY_THROW); diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index 14e42fb9a022..a923fdcbbcbc 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -30,6 +30,7 @@ #include <comphelper/classids.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/documentconstants.hxx> +#include <comphelper/propertysequence.hxx> using namespace ::com::sun::star; @@ -121,12 +122,10 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati if ( !m_xConfigProvider.is() ) m_xConfigProvider = configuration::theDefaultProvider::get( m_xContext ); - uno::Sequence< uno::Any > aArgs( 1 ); - beans::PropertyValue aPathProp; - aPathProp.Name = "nodepath"; - aPathProp.Value <<= aPath; - aArgs[0] <<= aPathProp; - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(aPath)} + })); xConfig.set( m_xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgs ), diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 6acb9a6c35d9..c1a90263286d 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -46,6 +46,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <unotools/confignode.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -824,20 +825,11 @@ namespace connectivity // arguments for creating the config access - Sequence< Any > aArguments(2); - // the path to the node to open - aArguments[0] <<= PropertyValue( - "nodepath", 0, - makeAny( OUString("/org.openoffice.Setup/L10N" ) ), - PropertyState_DIRECT_VALUE - ); - // the depth: -1 means unlimited - aArguments[1] <<= PropertyValue( - "depth", 0, - makeAny( (sal_Int32)-1 ), PropertyState_DIRECT_VALUE - ); - - + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", Any(OUString("/org.openoffice.Setup/L10N" ))}, // the path to the node to open + {"depth", Any((sal_Int32)-1)}, // the depth: -1 means unlimited + })); // create the access Reference< XPropertySet > xNode( xConfigProvider->createInstanceWithArguments( diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 3550e3ace05f..f55dea3af038 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/rendering/PanoseWeight.hpp> #include <com/sun/star/rendering/TexturingMode.hpp> #include <com/sun/star/rendering/XCanvas.hpp> +#include <comphelper/propertysequence.hxx> #include <bitmapaction.hxx> #include <implrenderer.hxx> @@ -510,18 +511,12 @@ namespace cppcanvas rParms.mrCanvas->getUNOCanvas()->getDevice()->getParametricPolyPolygonFactory() ); if( xFactory.is() ) { - uno::Sequence<uno::Any> args( 3 ); - beans::PropertyValue aProp; - aProp.Name = "Colors"; - aProp.Value <<= aColors; - args[0] <<= aProp; - aProp.Name = "Stops"; - aProp.Value <<= aStops; - args[1] <<= aProp; - aProp.Name = "AspectRatio"; - aProp.Value <<= static_cast<sal_Int32>(1); - args[2] <<= aProp; - + uno::Sequence<uno::Any> args(comphelper::InitAnyPropertySequence( + { + {"Colors", uno::Any(aColors)}, + {"Stops", uno::Any(aStops)}, + {"AspectRatio", uno::Any(static_cast<sal_Int32>(1))}, + })); aTexture.Gradient.set( xFactory->createInstanceWithArguments( aGradientService, args ), diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index a72629edc8b7..2a2f75c9f7d0 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -21,6 +21,7 @@ #include <vcl/svapp.hxx> #include <comphelper/sequence.hxx> #include <comphelper/anytostring.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppcanvas/canvas.hxx> #include <com/sun/star/rendering/XGraphicDevice.hpp> @@ -681,18 +682,12 @@ namespace cppcanvas ::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform, aGradInfo.getTextureTransform() ); - uno::Sequence<uno::Any> args(3); - beans::PropertyValue aProp; - aProp.Name = "Colors"; - aProp.Value <<= aColors; - args[0] <<= aProp; - aProp.Name = "Stops"; - aProp.Value <<= aStops; - args[1] <<= aProp; - aProp.Name = "AspectRatio"; - aProp.Value <<= aGradInfo.getAspectRatio(); - args[2] <<= aProp; - + uno::Sequence<uno::Any> args(comphelper::InitAnyPropertySequence( + { + {"Colors", uno::Any(aColors)}, + {"Stops", uno::Any(aStops)}, + {"AspectRatio", uno::Any(aGradInfo.getAspectRatio())}, + })); aTexture.Gradient.set( xFactory->createInstanceWithArguments(aGradientService, args), diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 675e6370907a..0e9777aa1e19 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -95,6 +95,7 @@ #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/util/thePathSettings.hpp> +#include <comphelper/propertysequence.hxx> #include "dlgname.hxx" @@ -2968,17 +2969,11 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow, uno::Reference< css::embed::XStorage > xStorage( xStorageFactory->createInstanceWithArguments( aArgs ), uno::UNO_QUERY ); - uno::Sequence< uno::Any > aProp( 2 ); - beans::PropertyValue aPropValue; - - aPropValue.Name = "UserConfigStorage"; - aPropValue.Value <<= xStorage; - aProp[ 0 ] <<= aPropValue; - - aPropValue.Name = "OpenMode"; - aPropValue.Value <<= css::embed::ElementModes::READWRITE; - aProp[ 1 ] <<= aPropValue; - + uno::Sequence<uno::Any> aProp(comphelper::InitAnyPropertySequence( + { + {"UserConfigStorage", uno::Any(xStorage)}, + {"OpenMode", uno::Any(css::embed::ElementModes::READWRITE)} + })); m_xImportedImageManager = css::ui::ImageManager::create( xComponentContext ); m_xImportedImageManager->initialize(aProp); diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 84ecbb97fb83..5d6829912867 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -44,6 +44,7 @@ #include <sfx2/objsh.hxx> #include <comphelper/string.hxx> #include <comphelper/types.hxx> +#include <comphelper/propertysequence.hxx> #include <svtools/langtab.hxx> #include <unotools/localfilehelper.hxx> #include <unotools/configmgr.hxx> @@ -464,26 +465,24 @@ CanvasSettings::CanvasSettings() : css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext())); - Any propValue( - Any( NamedValue( - "nodepath", - Any( OUString("/org.openoffice.Office.Canvas") ) ) ) ); - + Sequence<Any> aArgs1(comphelper::InitAnyPropertySequence( + { + {"nodepath", Any(OUString("/org.openoffice.Office.Canvas"))} + })); mxForceFlagNameAccess.set( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", - Sequence<Any>( &propValue, 1 ) ), + aArgs1 ), UNO_QUERY_THROW ); - propValue <<= - NamedValue( - "nodepath", - Any( OUString("/org.openoffice.Office.Canvas/CanvasServiceList") ) ); - + Sequence<Any> aArgs2(comphelper::InitAnyPropertySequence( + { + {"nodepath", Any(OUString("/org.openoffice.Office.Canvas/CanvasServiceList"))} + })); Reference<XNameAccess> xNameAccess( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - Sequence<Any>( &propValue, 1 ) ), UNO_QUERY_THROW ); + aArgs2 ), UNO_QUERY_THROW ); Reference<XHierarchicalNameAccess> xHierarchicalNameAccess( xNameAccess, UNO_QUERY_THROW); diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx index 5d442e62c30b..7fb8872fe14e 100644 --- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx +++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx @@ -25,6 +25,7 @@ #include <comphelper/sequence.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <comphelper/property.hxx> +#include <comphelper/propertysequence.hxx> #include "definitioncolumn.hxx" using namespace ::com::sun::star::uno; @@ -77,11 +78,10 @@ void OComponentDefinition::initialize( const Sequence< Any >& aArguments ) OUString rName; if( (aArguments.getLength() == 1) && (aArguments[0] >>= rName) ) { - Sequence< Any > aNewArgs(1); - PropertyValue aValue; - aValue.Name = PROPERTY_NAME; - aValue.Value <<= rName; - aNewArgs[0] <<= aValue; + Sequence<Any> aNewArgs(comphelper::InitAnyPropertySequence( + { + {PROPERTY_NAME, Any(rName)} + })); OContentHelper::initialize(aNewArgs); } else diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 2d1f03d8cd87..543242afb2bc 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -37,6 +37,7 @@ #include "core_resource.hxx" #include "strings.hrc" #include <comphelper/namedvaluecollection.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <vcl/svapp.hxx> @@ -338,20 +339,12 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments for(;elements != elementsEnd;++elements) { xCopyFrom->getByName(*elements) >>= xObjectToCopy; - Sequence< Any > aArguments(3); - PropertyValue aArgument; - // set as folder - aArgument.Name = "Name"; - aArgument.Value <<= *elements; - aArguments[0] <<= aArgument; - //parent - aArgument.Name = "Parent"; - aArgument.Value <<= xContent; - aArguments[1] <<= aArgument; - - aArgument.Name = PROPERTY_EMBEDDEDOBJECT; - aArgument.Value <<= xObjectToCopy; - aArguments[2] <<= aArgument; + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"Name", Any(*elements)}, // set as folder + {"Parent", Any(xContent)}, + {PROPERTY_EMBEDDEDOBJECT, Any(xObjectToCopy)}, + })); OUString sServiceName; if ( Reference< XNameAccess >( xObjectToCopy, UNO_QUERY ).is() ) diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 744ca5464122..4c7fd57ab7d3 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -27,6 +27,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/classids.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/frame/XUntitledNumbers.hpp> #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/Size.hpp> @@ -1345,21 +1346,12 @@ void ODocumentDefinition::saveAs() rename(pDocuSave->getName()); updateDocumentTitle(); - Sequence< Any > aArguments(3); - PropertyValue aValue; - // set as folder - aValue.Name = PROPERTY_NAME; - aValue.Value <<= sOldName; - aArguments[0] <<= aValue; - - aValue.Name = PROPERTY_PERSISTENT_NAME; - aValue.Value <<= sPersistentName; - aArguments[1] <<= aValue; - - aValue.Name = PROPERTY_AS_TEMPLATE; - aValue.Value <<= m_pImpl->m_aProps.bAsTemplate; - aArguments[2] <<= aValue; - + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {PROPERTY_NAME, uno::Any(sOldName)}, // set as folder + {PROPERTY_PERSISTENT_NAME, uno::Any(sPersistentName)}, + {PROPERTY_AS_TEMPLATE, uno::Any(m_pImpl->m_aProps.bAsTemplate)}, + })); Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW ); Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) ); Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW ); @@ -2017,15 +2009,11 @@ void ODocumentDefinition::fillReportData( const Reference< XComponentContext >& const Reference< util::XCloseable >& _rxComponent, const Reference< XConnection >& _rxActiveConnection ) { - Sequence< Any > aArgs(2); - PropertyValue aValue; - aValue.Name = "TextDocument"; - aValue.Value <<= _rxComponent; - aArgs[0] <<= aValue; - aValue.Name = "ActiveConnection"; - aValue.Value <<= _rxActiveConnection; - aArgs[1] <<= aValue; - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"TextDocument", uno::Any(_rxComponent)}, + {"ActiveConnection", uno::Any(_rxActiveConnection)} + })); try { Reference< XJobExecutor > xExecuteable( 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); diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index e7267ca68ca7..78ee969ccdd1 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -25,6 +25,7 @@ #include "strings.hrc" #include <comphelper/processfactory.hxx> #include <comphelper/interaction.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/exc_hlp.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -148,16 +149,11 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, Button*, void) } else // sub folder doesn't exist { - Sequence< Any > aValues(2); - PropertyValue aValue; - aValue.Name = "ResourceName"; - aValue.Value <<= sSubFolder; - aValues[0] <<= aValue; - - aValue.Name = "ResourceType"; - aValue.Value <<= OUString("folder"); - aValues[1] <<= aValue; - + Sequence<Any> aValues(comphelper::InitAnyPropertySequence( + { + {"ResourceName", Any(sSubFolder)}, + {"ResourceType", Any(OUString("folder"))} + })); InteractiveAugmentedIOException aException(OUString(),Reference<XInterface>(), InteractionClassification_ERROR, IOErrorCode_NOT_EXISTING_PATH,aValues); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 10b7f2a07b36..1458bb93a853 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -70,6 +70,7 @@ #include "FieldDescriptions.hxx" #include <comphelper/processfactory.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/propertysequence.hxx> #include <svx/svxids.hrc> @@ -1378,21 +1379,12 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo try { Reference<XMultiServiceFactory> xORB( xNameAccess, UNO_QUERY_THROW ); - Sequence< Any > aArguments(3); - PropertyValue aValue; - // set as folder - aValue.Name = "Name"; - aValue.Value <<= sNewName; - aArguments[0] <<= aValue; - //parent - aValue.Name = "Parent"; - aValue.Value <<= xNameAccess; - aArguments[1] <<= aValue; - - aValue.Name = PROPERTY_EMBEDDEDOBJECT; - aValue.Value <<= _xContent; - aArguments[2] <<= aValue; - + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"Name", uno::Any(sNewName)}, // set as folder + {"Parent", uno::Any(xNameAccess)}, + {PROPERTY_EMBEDDEDOBJECT, uno::Any(_xContent)}, + })); OUString sServiceName(_bCollection ? ((_bForm) ? OUString(SERVICE_NAME_FORM_COLLECTION) : OUString(SERVICE_NAME_REPORT_COLLECTION)) : OUString(SERVICE_SDB_DOCUMENTDEFINITION)); Reference<XContent > xNew( xORB->createInstanceWithArguments( sServiceName, aArguments ), UNO_QUERY_THROW ); diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index 7d7f003a5f57..222fd7bf05dd 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -24,6 +24,7 @@ #include "stringconstants.hxx" #include "strings.hxx" #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/typeprovider.hxx> #include <connectivity/dbexception.hxx> @@ -91,10 +92,12 @@ void OSQLMessageDialog::initialize(Sequence<Any> const & args) Reference< css::awt::XWindow > parentWindow; if ((args.getLength() == 3) && (args[0] >>= title) && (args[1] >>= parentWindow)) { - Sequence<Any> s(3); - s[0] <<= PropertyValue( "Title", -1, makeAny(title), PropertyState_DIRECT_VALUE); - s[1] <<= PropertyValue( "ParentWindow", -1, makeAny(parentWindow), PropertyState_DIRECT_VALUE); - s[2] <<= PropertyValue( "SQLException", -1, args[2], PropertyState_DIRECT_VALUE); + Sequence<Any> s(comphelper::InitAnyPropertySequence( + { + {"Title", Any(title)}, + {"ParentWindow", Any(parentWindow)}, + {"SQLException", args[2]} + })); OGenericUnoDialog::initialize(s); } else { OGenericUnoDialog::initialize(args); diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index ebbad45dd4e3..fa8724c84ccb 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/frame/TerminationVetoException.hpp> #include <com/sun/star/ucb/CommandAbortedException.hpp> #include <com/sun/star/ucb/CommandFailedException.hpp> +#include <comphelper/propertysequence.hxx> #include "dp_gui_dialog2.hxx" #include "dp_gui_extensioncmdqueue.hxx" @@ -64,23 +65,22 @@ TheExtensionManager::TheExtensionManager( const uno::Reference< awt::XWindow > & uno::Reference< lang::XMultiServiceFactory > xConfig( configuration::theDefaultProvider::get(xContext)); - uno::Any args[1]; - beans::PropertyValue aValue( "nodepath", 0, uno::Any( OUString("/org.openoffice.Office.OptionsDialog/Nodes") ), - beans::PropertyState_DIRECT_VALUE ); - args[0] <<= aValue; + uno::Sequence<uno::Any> args(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.OptionsDialog/Nodes"))} + })); m_xNameAccessNodes.set( - xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - uno::Sequence< uno::Any >( args, 1 )), + xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args), uno::UNO_QUERY_THROW); // get the 'get more extensions here' url + uno::Sequence<uno::Any> args2(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.ExtensionManager/ExtensionRepositories"))} + })); uno::Reference< container::XNameAccess > xNameAccessRepositories; - beans::PropertyValue aValue2( "nodepath", 0, uno::Any( OUString("/org.openoffice.Office.ExtensionManager/ExtensionRepositories") ), - beans::PropertyState_DIRECT_VALUE ); - args[0] <<= aValue2; xNameAccessRepositories.set( - xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - uno::Sequence< uno::Any >( args, 1 )), + xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args2), uno::UNO_QUERY_THROW); try { //throws css::container::NoSuchElementException, css::lang::WrappedTargetException diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index b1762ab7fd87..3acd182a8ed8 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -25,6 +25,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/seqstream.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <boost/optional.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -350,12 +351,10 @@ void DescriptionInfoset::checkBlacklist() const if (currentversion.getLength() == 0) return; // nothing to check - css::uno::Sequence< css::uno::Any > args = css::uno::Sequence< css::uno::Any >(1); - css::beans::PropertyValue prop; - prop.Name = "nodepath"; - prop.Value <<= OUString("/org.openoffice.Office.ExtensionDependencies/Extensions"); - args[0] <<= prop; - + css::uno::Sequence<css::uno::Any> args(comphelper::InitAnyPropertySequence( + { + {"nodepath", css::uno::Any(OUString("/org.openoffice.Office.ExtensionDependencies/Extensions"))} + })); css::uno::Reference< css::container::XNameAccess > blacklist( (css::configuration::theDefaultProvider::get(m_context) ->createInstanceWithArguments( diff --git a/extensions/source/abpilot/admininvokationimpl.cxx b/extensions/source/abpilot/admininvokationimpl.cxx index d0d183985f5b..7253d400fbc5 100644 --- a/extensions/source/abpilot/admininvokationimpl.cxx +++ b/extensions/source/abpilot/admininvokationimpl.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/sdbc/DriverManager.hpp> +#include <comphelper/propertysequence.hxx> #include <vcl/stdtext.hxx> #include <toolkit/helper/vclunohelper.hxx> #include "strings.hrc" @@ -66,19 +67,13 @@ namespace abp static const char s_sDataSourceTypeChangeDialog[] = "com.sun.star.sdb.DataSourceTypeChangeDialog"; // the parameters for the call - Sequence< Any > aArguments(3); - Any* pArguments = aArguments.getArray(); - - // the parent window - Reference< XWindow > xDialogParent = VCLUnoHelper::GetInterface(m_pMessageParent); - *pArguments++ <<= PropertyValue("ParentWindow", -1, makeAny(xDialogParent), PropertyState_DIRECT_VALUE); - - // the title of the dialog - OUString sAdminDialogTitle(compmodule::ModuleRes(RID_STR_ADMINDIALOGTITLE)); - *pArguments++ <<= PropertyValue("Title", -1, makeAny(sAdminDialogTitle), PropertyState_DIRECT_VALUE); + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", Any(VCLUnoHelper::GetInterface(m_pMessageParent))}, + {"Title", Any(compmodule::ModuleRes(RID_STR_ADMINDIALOGTITLE))}, + {"InitialSelection", Any(m_xDataSource)}, // the name of the new data source + })); - // the name of the new data source - *pArguments++ <<= PropertyValue("InitialSelection", -1, makeAny(m_xDataSource), PropertyState_DIRECT_VALUE); // create the dialog Reference< XExecutableDialog > xDialog; 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() ) 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 diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx index 1a600b0ea75a..1895daa7f376 100644 --- a/framework/source/uifactory/factoryconfiguration.cxx +++ b/framework/source/uifactory/factoryconfiguration.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/container/XContainer.hpp> #include <rtl/ustrbuf.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/weak.hxx> // Defines @@ -192,13 +193,10 @@ void ConfigurationAccess_ControllerFactory::readConfigurationData() if ( !m_bConfigAccessInitialized ) { - Sequence< Any > aArgs( 1 ); - PropertyValue aPropValue; - - aPropValue.Name = "nodepath"; - aPropValue.Value <<= m_sRoot; - aArgs[0] <<= aPropValue; - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(m_sRoot)} + })); try { m_xConfigAccess.set( m_xConfigProvider->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,aArgs ), UNO_QUERY ); diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx index ee455a54d2bb..5524e3118528 100644 --- a/framework/source/uifactory/uielementfactorymanager.cxx +++ b/framework/source/uifactory/uielementfactorymanager.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/ui/XUIElementFactoryManager.hpp> #include <rtl/ustrbuf.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> @@ -263,12 +264,10 @@ void ConfigurationAccess_FactoryManager::readConfigurationData() if ( !m_bConfigAccessInitialized ) { - Sequence< Any > aArgs( 1 ); - PropertyValue aPropValue; - - aPropValue.Name = "nodepath"; - aPropValue.Value <<= m_sRoot; - aArgs[0] <<= aPropValue; + Sequence<Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", Any(m_sRoot)} + })); try { diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index a5308ba3696a..cd2e9fecac3a 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -29,6 +29,7 @@ #include <nativenumbersupplier.hxx> #include <stdio.h> #include <string.h> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> // Cyrillic upper case @@ -983,11 +984,10 @@ DefaultNumberingProvider::isScriptFlagEnabled(const OUString& aName) if (! xConfigProvider.is()) throw RuntimeException(); - Sequence< Any > aArgs(1); - beans::PropertyValue aPath; - aPath.Name = "nodepath"; - aPath.Value <<= OUString("/org.openoffice.Office.Common/I18N"); - aArgs[0] <<= aPath; + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.Common/I18N"))} + })); Reference<XInterface> xInterface = xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgs); diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 5a04e5e2b7dc..c9713e4b2235 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -21,6 +21,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/property.hxx> #include <comphelper/types.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include "strings.hxx" #include <toolkit/helper/vclunohelper.hxx> @@ -483,27 +484,15 @@ sal_Bool SAL_CALL DataProviderHandler::suspend(sal_Bool Suspend) } bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - uno::Sequence<uno::Any> aSeq(6); - beans::PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value = m_xContext->getValueByName("DialogParentWindow"); - aSeq[0] <<= aParam; - aParam.Name = "Detail"; - aParam.Value <<= m_xDataProvider; - aSeq[1] <<= aParam; - aParam.Name = "Master"; - aParam.Value <<= m_xReportComponent->getSection()->getReportDefinition(); - aSeq[2] <<= aParam; - - aParam.Name = "Explanation"; - aParam.Value <<= RptResId(RID_STR_EXPLANATION); - aSeq[3] <<= aParam; - aParam.Name = "DetailLabel"; - aParam.Value <<= RptResId(RID_STR_DETAILLABEL); - aSeq[4] <<= aParam; - aParam.Name = "MasterLabel"; - aParam.Value <<= RptResId(RID_STR_MASTERLABEL); - aSeq[5] <<= aParam; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(m_xContext->getValueByName("DialogParentWindow"))}, + {"Detail", uno::Any(m_xDataProvider)}, + {"Master", uno::Any(m_xReportComponent->getSection()->getReportDefinition())}, + {"Explanation", uno::Any(RptResId(RID_STR_EXPLANATION))}, + {"DetailLabel", uno::Any(RptResId(RID_STR_DETAILLABEL))}, + {"MasterLabel", uno::Any(RptResId(RID_STR_MASTERLABEL))}, + })); uno::Reference< ui::dialogs::XExecutableDialog > xDialog( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( @@ -516,14 +505,11 @@ bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutex bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - uno::Sequence<uno::Any> aSeq(2); - beans::PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value = m_xContext->getValueByName("DialogParentWindow"); - aSeq[0] <<= aParam; - aParam.Name = "ChartModel"; - aParam.Value <<= m_xChartModel; - aSeq[1] <<= aParam; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(m_xContext->getValueByName("DialogParentWindow"))}, + {"ChartModel", uno::Any(m_xChartModel)} + })); uno::Reference< ui::dialogs::XExecutableDialog > xDialog( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 025934679a6c..3409bfa3db43 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -48,6 +48,7 @@ #include <cppuhelper/component_context.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/embed/EmbedVerbs.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/chart2/data/XDataProvider.hpp> @@ -650,18 +651,11 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY ); if( xChartModel.is() && xInit.is() ) { - uno::Reference< awt::XWindow > xDialogParentWindow(nullptr); - // initialize dialog - uno::Sequence<uno::Any> aSeq(2); - uno::Any* pArray = aSeq.getArray(); - beans::PropertyValue aParam1; - aParam1.Name = "ParentWindow"; - aParam1.Value <<= xDialogParentWindow; - beans::PropertyValue aParam2; - aParam2.Name = "ChartModel"; - aParam2.Value <<= xChartModel; - pArray[0] <<= aParam1; - pArray[1] <<= aParam2; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(uno::Reference< awt::XWindow >())}, + {"ChartModel", uno::Any(xChartModel)} + })); xInit->initialize( aSeq ); // try to set the dialog's position so it doesn't hide the chart diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index e559a6b782c8..269ff7a68890 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -26,6 +26,7 @@ #include <sfx2/viewfrm.hxx> #include <comphelper/lok.hxx> +#include <comphelper/propertysequence.hxx> #include <svl/stritem.hxx> #include <svl/whiter.hxx> #include <svl/zforlist.hxx> @@ -1749,13 +1750,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if( xInit.is() ) { // initialize dialog - Reference< awt::XWindow > xDialogParentWindow(nullptr); - Sequence<Any> aSeq(1); - Any* pArray = aSeq.getArray(); - PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value <<= xDialogParentWindow; - pArray[0] <<= aParam; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(Reference< awt::XWindow >())} + })); xInit->initialize( aSeq ); //execute dialog diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 2163676af665..3754479cb46d 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -303,16 +303,14 @@ void CustomAnimationPresets::importEffects() configuration::theDefaultProvider::get( xContext ); // read path to transition effects files from config - Any propValue = uno::makeAny( - beans::PropertyValue( - "nodepath", -1, - uno::makeAny( OUString( "/org.openoffice.Office.Impress/Misc" )), - beans::PropertyState_DIRECT_VALUE ) ); - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.Impress/Misc"))} + })); Reference<container::XNameAccess> xNameAccess( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - Sequence<Any>( &propValue, 1 ) ), UNO_QUERY_THROW ); + aArgs ), UNO_QUERY_THROW ); uno::Sequence< OUString > aFiles; xNameAccess->getByName( "EffectFiles" ) >>= aFiles; diff --git a/sd/source/core/TransitionPreset.cxx b/sd/source/core/TransitionPreset.cxx index 6c0746a69e37..17496dd95972 100644 --- a/sd/source/core/TransitionPreset.cxx +++ b/sd/source/core/TransitionPreset.cxx @@ -29,6 +29,7 @@ #include <unotools/streamwrap.hxx> #include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <unotools/pathoptions.hxx> #include <officecfg/Office/UI/Effects.hxx> #include <tools/stream.hxx> @@ -205,15 +206,14 @@ bool TransitionPreset::importTransitionPresetList( TransitionPresetList& rList ) configuration::theDefaultProvider::get( xContext ); // read path to transition effects files from config - Any propValue = uno::makeAny( - beans::PropertyValue("nodepath", -1, - uno::makeAny( OUString("/org.openoffice.Office.Impress/Misc")), - beans::PropertyState_DIRECT_VALUE ) ); - + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Office.Impress/Misc"))} + })); Reference<container::XNameAccess> xNameAccess( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - Sequence<Any>( &propValue, 1 ) ), + aArgs), UNO_QUERY_THROW ); uno::Sequence< OUString > aFiles; xNameAccess->getByName("TransitionFiles") >>= aFiles; diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx index 69048f3d3413..389bbecc1176 100644 --- a/sdext/source/minimizer/configurationaccess.cxx +++ b/sdext/source/minimizer/configurationaccess.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/util/theMacroExpander.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <comphelper/propertysequence.hxx> #include <sal/macros.h> using namespace ::com::sun::star; @@ -289,14 +290,11 @@ Reference< XInterface > ConfigurationAccess::OpenConfiguration( bool bReadOnly ) try { Reference< lang::XMultiServiceFactory > xProvider = configuration::theDefaultProvider::get( mxContext ); - Sequence< Any > aCreationArguments( 2 ); - aCreationArguments[0] <<= PropertyValue( - "nodepath", 0, - makeAny( GetPathToConfigurationRoot() ), - PropertyState_DIRECT_VALUE ); - aCreationArguments[1] <<= beans::PropertyValue( - "lazywrite", 0, makeAny( true ), - PropertyState_DIRECT_VALUE ); + uno::Sequence<uno::Any> aCreationArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(GetPathToConfigurationRoot())}, + {"lazywrite", uno::Any(true)} + })); OUString sAccessService; if ( bReadOnly ) sAccessService = "com.sun.star.configuration.ConfigurationAccess"; diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx index 262e2b145b8a..f6ce8b4421ba 100644 --- a/sdext/source/presenter/PresenterConfigurationAccess.cxx +++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/util/XChangesBatch.hpp> +#include <comphelper/propertysequence.hxx> #include <osl/diagnose.h> using namespace ::com::sun::star; @@ -45,22 +46,12 @@ PresenterConfigurationAccess::PresenterConfigurationAccess ( { if (rxContext.is()) { - Sequence<Any> aCreationArguments(3); - aCreationArguments[0] <<= beans::PropertyValue( - "nodepath", - 0, - makeAny(rsRootName), - beans::PropertyState_DIRECT_VALUE); - aCreationArguments[1] <<= beans::PropertyValue( - "depth", - 0, - makeAny((sal_Int32)-1), - beans::PropertyState_DIRECT_VALUE); - aCreationArguments[2] <<= beans::PropertyValue( - "lazywrite", - 0, - makeAny(true), - beans::PropertyState_DIRECT_VALUE); + uno::Sequence<uno::Any> aCreationArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(rsRootName)}, + {"depth", uno::Any((sal_Int32)-1)}, + {"lazywrite", uno::Any(true)} + })); OUString sAccessService; if (eMode == READ_ONLY) 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() ) { diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 0a6105b013cd..4ae249b893c2 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -50,6 +50,7 @@ #include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/util/theMacroExpander.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase.hxx> @@ -1301,19 +1302,11 @@ void JavaVirtualMachine::registerConfigChangesListener() { // We register this instance as listener to changes in org.openoffice.Inet/Settings // arguments for ConfigurationAccess - css::uno::Sequence< css::uno::Any > aArguments(2); - aArguments[0] <<= css::beans::PropertyValue( - "nodepath", - 0, - css::uno::makeAny(OUString("org.openoffice.Inet/Settings")), - css::beans::PropertyState_DIRECT_VALUE); - // depth: -1 means unlimited - aArguments[1] <<= css::beans::PropertyValue( - "depth", - 0, - css::uno::makeAny( (sal_Int32)-1), - css::beans::PropertyState_DIRECT_VALUE); - + css::uno::Sequence<css::uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", css::uno::Any(OUString("org.openoffice.Inet/Settings"))}, + {"depth", css::uno::Any((sal_Int32)-1)} + })); m_xInetConfiguration.set( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", @@ -1324,19 +1317,11 @@ void JavaVirtualMachine::registerConfigChangesListener() m_xInetConfiguration->addContainerListener(this); // now register as listener to changes in org.openoffice.Java/VirtualMachine - css::uno::Sequence< css::uno::Any > aArguments2(2); - aArguments2[0] <<= css::beans::PropertyValue( - "nodepath", - 0, - css::uno::makeAny(OUString("org.openoffice.Office.Java/VirtualMachine")), - css::beans::PropertyState_DIRECT_VALUE); - // depth: -1 means unlimited - aArguments2[1] <<= css::beans::PropertyValue( - "depth", - 0, - css::uno::makeAny( (sal_Int32)-1), - css::beans::PropertyState_DIRECT_VALUE); - + css::uno::Sequence<css::uno::Any> aArguments2(comphelper::InitAnyPropertySequence( + { + {"nodepath", css::uno::Any(OUString("org.openoffice.Office.Java/VirtualMachine"))}, + {"depth", css::uno::Any((sal_Int32)-1)} // depth: -1 means unlimited + })); m_xJavaConfiguration.set( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", 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; } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 3aa0f98d044a..ab78fad7aabc 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -116,6 +116,7 @@ #include <app.hrc> #include <comphelper/string.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/bootstrap.hxx> #include <langhelper.hxx> @@ -1289,13 +1290,10 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) if( xInit.is() ) { // initialize dialog - Reference< awt::XWindow > xDialogParentWindow(nullptr); - Sequence<Any> aSeq(1); - Any* pArray = aSeq.getArray(); - PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value <<= xDialogParentWindow; - pArray[0] <<= aParam; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(Reference<awt::XWindow>())} + })); xInit->initialize( aSeq ); //execute dialog diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 4169bac09886..1c5bbb245ab3 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/lang/XInitialization.hpp> +#include <comphelper/propertysequence.hxx> #include <swtypes.hxx> #include <view.hxx> #include <wrtsh.hxx> @@ -304,13 +305,10 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) return; // initialize dialog - Reference<awt::XWindow> xDialogParentWindow(nullptr); - Sequence<Any> aSequence(1); - Any* pArray = aSequence.getArray(); - PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value <<= xDialogParentWindow; - pArray[0] <<= aParam; + uno::Sequence<uno::Any> aSequence(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(Reference<awt::XWindow>())} + })); xInit->initialize( aSequence ); //execute dialog diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx index 435452b889d8..bc778aa90eea 100644 --- a/sw/source/uibase/table/chartins.cxx +++ b/sw/source/uibase/table/chartins.cxx @@ -48,6 +48,7 @@ #include <cppuhelper/bootstrap.hxx> #include <cppuhelper/component_context.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/chart2/data/XDataProvider.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -174,18 +175,12 @@ void SwInsertChart() uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY ); if( xInit.is() ) { - uno::Reference< awt::XWindow > xDialogParentWindow(nullptr); // initialize dialog - uno::Sequence<uno::Any> aSeq(2); - uno::Any* pArray = aSeq.getArray(); - beans::PropertyValue aParam1; - aParam1.Name = "ParentWindow"; - aParam1.Value <<= xDialogParentWindow; - beans::PropertyValue aParam2; - aParam2.Name = "ChartModel"; - aParam2.Value <<= xChartModel; - pArray[0] <<= aParam1; - pArray[1] <<= aParam2; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(uno::Reference< awt::XWindow >())}, + {"ChartModel", uno::Any(xChartModel)} + })); xInit->initialize( aSeq ); // try to set the dialog's position so it doesn't hide the chart diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index baba813b4fbb..be812b0deb51 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -26,6 +26,7 @@ #include <linguistic/lngprops.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> +#include <comphelper/propertysequence.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/msgbox.hxx> #include <svtools/ehdl.hxx> @@ -126,13 +127,10 @@ void SwView::ExecLingu(SfxRequest &rReq) if( xInit.is() ) { // initialize dialog - Reference< awt::XWindow > xDialogParentWindow(nullptr); - Sequence<Any> aSeq(1); - Any* pArray = aSeq.getArray(); - PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value <<= xDialogParentWindow; - pArray[0] <<= aParam; + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(Reference< awt::XWindow >())} + })); xInit->initialize( aSeq ); //execute dialog diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index ed617c47f077..8fcd8697cd79 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -26,6 +26,7 @@ #include <osl/diagnose.h> #include <comphelper/processfactory.hxx> #include <comphelper/interfacecontainer2.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/ucb/DuplicateProviderException.hpp> #include <com/sun/star/ucb/GlobalTransferCommandArgument2.hpp> @@ -854,11 +855,10 @@ bool UniversalContentBroker::getContentProviderData( makeAndAppendXMLName( aFullPath, rKey2 ); aFullPath.append( "']/ProviderData" ); - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name = "nodepath"; - aProperty.Value <<= aFullPath.makeStringAndClear(); - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(aFullPath.makeStringAndClear())} + })); uno::Reference< uno::XInterface > xInterface( xConfigProv->createInstanceWithArguments( diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index a20089a490b7..eecdd5dc1fa2 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -20,6 +20,7 @@ #include <memory> #include <osl/diagnose.h> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/exc_hlp.hxx> #include <rtl/ustring.h> @@ -501,15 +502,13 @@ uno::Reference< ucb::XContent > createNew( xTarget, uno::UNO_QUERY ); if ( !xCommandProcessorT.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Folder", - -1, - uno::makeAny(rContext.aArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(rContext.aArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "Target is no XCommandProcessor!", rContext.xProcessor ); @@ -552,15 +551,13 @@ uno::Reference< ucb::XContent > createNew( if ( !xCreator.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Folder", - -1, - uno::makeAny(rContext.aArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(rContext.aArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "Target is no XContentCreator!", rContext.xProcessor ); @@ -573,15 +570,13 @@ uno::Reference< ucb::XContent > createNew( sal_Int32 nCount = aTypesInfo.getLength(); if ( !nCount ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Folder", - -1, - uno::makeAny(rContext.aArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(rContext.aArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "No types creatable!", rContext.xProcessor ); @@ -683,16 +678,13 @@ uno::Reference< ucb::XContent > createNew( if ( !xNew.is() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Folder", - -1, - uno::makeAny(rContext.aArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(rContext.aArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "createNewContent failed!", rContext.xProcessor ); @@ -722,15 +714,13 @@ void transferProperties( if ( !xInfo.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rContext.aArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rContext.aArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "Unable to get propertyset info from source object!", rContext.xProcessor ); @@ -750,15 +740,13 @@ void transferProperties( if ( !xRow1.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rContext.aArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rContext.aArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "Unable to get properties from source object!", rContext.xProcessor ); @@ -1012,17 +1000,13 @@ void handleNameClashRename( if ( !xRow.is() ) { - uno::Any aProps2 - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( - xNew->getIdentifier()->getContentIdentifier() ), - beans::PropertyState_DIRECT_VALUE ) ); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(xNew->getIdentifier()->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >( &aProps2, 1 ), + aArgs, rContext.xOrigEnv, "Unable to get properties from new object!", rContext.xProcessor ); @@ -1100,18 +1084,13 @@ void handleNameClashRename( = getInputStream( rContext, xCommandProcessorS ); if ( !xInputStream.is() ) { - uno::Any aProps2 - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( - xNew->getIdentifier()-> - getContentIdentifier() ), - beans::PropertyState_DIRECT_VALUE ) ); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(xNew->getIdentifier()->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >( &aProps2, 1 ), + aArgs, rContext.xOrigEnv, "Got no data stream from source!", rContext.xProcessor ); @@ -1203,15 +1182,13 @@ void globalTransfer_( bSourceIsLink ); if ( !xNew.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Folder", - -1, - uno::makeAny(rContext.aArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(rContext.aArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "No matching content type at target!", rContext.xProcessor ); @@ -1249,15 +1226,13 @@ void globalTransfer_( xSource, uno::UNO_QUERY ); if ( !xCommandProcessorS.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rContext.aArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rContext.aArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "Source content is not a XCommandProcessor!", rContext.xProcessor ); @@ -1513,16 +1488,13 @@ void globalTransfer_( if ( !xChildAccess.is() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rContext.aArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rContext.aArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, rContext.xOrigEnv, "Unable to get children of source!", rContext.xProcessor ); @@ -1652,15 +1624,13 @@ void UniversalContentBroker::globalTransfer( if ( !xTarget.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Can't instantiate target object!", this ); @@ -1674,16 +1644,13 @@ void UniversalContentBroker::globalTransfer( xTarget, uno::UNO_QUERY ); if ( !xCommandProcessor.is() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rArg.TargetURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Target content is not a XCommandProcessor!", this ); @@ -1835,15 +1802,13 @@ void UniversalContentBroker::globalTransfer( if ( !xSource.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Can't instantiate source object!", this ); @@ -1854,15 +1819,13 @@ void UniversalContentBroker::globalTransfer( xSource, uno::UNO_QUERY ); if ( !xCommandProcessor.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Source content is not a XCommandProcessor!", this ); @@ -1892,15 +1855,13 @@ void UniversalContentBroker::globalTransfer( if ( !xRow.is() ) { - uno::Any aProps2 - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rArg.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps2, 1), + aArgs, xEnv, "Unable to get properties from source object!", this ); @@ -1979,14 +1940,13 @@ uno::Any UniversalContentBroker::checkIn( const ucb::CheckinArgument& rArg, if ( !xTarget.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", -1, - uno::makeAny( rArg.TargetURL ), - beans::PropertyState_DIRECT_VALUE ) ); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >( &aProps, 1 ), + aArgs, xEnv, "Can't instantiate target object!", this ); @@ -1997,15 +1957,13 @@ uno::Any UniversalContentBroker::checkIn( const ucb::CheckinArgument& rArg, xTarget, uno::UNO_QUERY ); if ( !xCommandProcessor.is() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", -1, - uno::makeAny( rArg.TargetURL ), - beans::PropertyState_DIRECT_VALUE ) ); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rArg.TargetURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >( &aProps, 1 ), + aArgs, xEnv, "Target content is not a XCommandProcessor!", this ); diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 05a7a0afc09a..712ef0ae4fc1 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -32,6 +32,7 @@ #include <rtl/ref.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <comphelper/interfacecontainer2.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/beans/IllegalTypeException.hpp> #include <com/sun/star/beans/NotRemoveableException.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -939,12 +940,10 @@ Reference< XInterface > PropertySetRegistry::getRootConfigReadAccess() if ( m_pImpl->m_xConfigProvider.is() ) { - Sequence< Any > aArguments( 1 ); - PropertyValue aProperty; - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value - <<= OUString( STORE_CONTENTPROPERTIES_KEY ); - aArguments[ 0 ] <<= aProperty; + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, Any(OUString( STORE_CONTENTPROPERTIES_KEY ))} + })); m_pImpl->m_bTriedToGetRootReadAccess = true; @@ -997,16 +996,11 @@ Reference< XInterface > PropertySetRegistry::getConfigWriteAccess( if ( m_pImpl->m_xConfigProvider.is() ) { - Sequence< Any > aArguments( 2 ); - PropertyValue aProperty; - - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value <<= OUString( STORE_CONTENTPROPERTIES_KEY ); - aArguments[ 0 ] <<= aProperty; - - aProperty.Name = CFGPROPERTY_LAZYWRITE; - aProperty.Value <<= true; - aArguments[ 1 ] <<= aProperty; + Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, Any(OUString( STORE_CONTENTPROPERTIES_KEY ))}, + {CFGPROPERTY_LAZYWRITE, Any(true)} + })); m_pImpl->m_bTriedToGetRootWriteAccess = true; diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index 8ae56e8fba74..c082cba44703 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/ucb/NameClash.hpp> #include <com/sun/star/ucb/OpenCommandArgument.hpp> #include <com/sun/star/ucb/Store.hpp> +#include <comphelper/propertysequence.hxx> #include <rtl/uri.hxx> #include "filtask.hxx" @@ -973,11 +974,10 @@ TaskManager::setv( const OUString& aUnqPath, if( err ) { --propChanged; // unsuccessful setting - uno::Sequence< uno::Any > names( 1 ); - ret[0] <<= beans::PropertyValue( - "Uri", -1, - uno::makeAny(aUnqPath), - beans::PropertyState_DIRECT_VALUE); + uno::Sequence<uno::Any> names(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(aUnqPath)} + })); ret[i] <<= InteractiveAugmentedIOException( OUString(), nullptr, @@ -1036,11 +1036,10 @@ TaskManager::setv( const OUString& aUnqPath, if( err != osl::FileBase::E_None ) { --propChanged; // unsuccessful setting - uno::Sequence< uno::Any > names( 1 ); - names[0] <<= beans::PropertyValue( - "Uri", -1, - uno::makeAny(aUnqPath), - beans::PropertyState_DIRECT_VALUE); + uno::Sequence<uno::Any> names(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(aUnqPath)} + })); IOErrorCode ioError; switch( err ) { diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 5546a56f8005..199d30a505c3 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -41,6 +41,7 @@ #include "curl.hxx" #include <curl/easy.h> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <ucbhelper/cancelcommandexecution.hxx> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/fd_inputstream.hxx> @@ -322,13 +323,10 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, case THROWACCESSDENIED: { - Sequence<Any> seq(1); - PropertyValue value; - value.Name = "Uri"; - value.Handle = -1; - value.Value <<= m_aFTPURL.ident(false,false); - value.State = PropertyState_DIRECT_VALUE; - seq[0] <<= value; + Sequence<Any> seq(comphelper::InitAnyPropertySequence( + { + {"Uri", Any(m_aFTPURL.ident(false,false))} + })); ucbhelper::cancelCommandExecution( IOErrorCode_ACCESS_DENIED, seq, @@ -357,13 +355,10 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, } case THROWNOFILE: { - Sequence<Any> seq(1); - PropertyValue value; - value.Name = "Uri"; - value.Handle = -1; - value.Value <<= m_aFTPURL.ident(false,false); - value.State = PropertyState_DIRECT_VALUE; - seq[0] <<= value; + Sequence<Any> seq(comphelper::InitAnyPropertySequence( + { + {"Uri", Any(m_aFTPURL.ident(false,false))} + })); ucbhelper::cancelCommandExecution( IOErrorCode_NO_FILE, seq, diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index fe1750221fee..f6b02647e732 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -63,6 +63,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/propertyvalueset.hxx> #include <ucbhelper/cancelcommandexecution.hxx> @@ -427,17 +428,13 @@ uno::Any SAL_CALL HierarchyContent::execute( // Remove own and all children's persistent data. if ( !removeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, Environment, "Cannot remove persistent data!", this ); @@ -1285,17 +1282,13 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( { if ( !storeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot store persistent data!", this ); @@ -1432,16 +1425,13 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, if ( !storeData() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot store persistent data!", this ); @@ -1555,15 +1545,13 @@ void HierarchyContent::transfer( { if ( aId.startsWith( rInfo.SourceURL ) ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rInfo.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_RECURSIVE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Target is equal to or is a child of source!", this ); @@ -1594,15 +1582,13 @@ void HierarchyContent::transfer( if ( !xSource.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(xId->getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(xId->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot instantiate source object!", this ); @@ -1627,15 +1613,13 @@ void HierarchyContent::transfer( createNewContent( aContentInfo ).get() ); if ( !xTarget.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Folder", - -1, - uno::makeAny(aId), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(aId)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "XContentCreator::createNewContent failed!", this ); @@ -1756,18 +1740,13 @@ void HierarchyContent::transfer( // Remove all persistent data of source and its children. if ( !xSource->removeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( - xSource->m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(xSource->m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot remove persistent data of source object!", this ); diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index b9ce98c567d2..bef1f9bd3883 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/util/XOfficeInstallationDirectories.hpp> +#include <comphelper/propertysequence.hxx> #include "hierarchyprovider.hxx" #include "hierarchyuri.hxx" @@ -284,12 +285,10 @@ bool HierarchyEntry::setData( const HierarchyEntryData& rData ) bRoot = false; } - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value <<= aParentPath; - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, uno::Any(aParentPath)} + })); uno::Reference< util::XChangesBatch > xBatch( m_xConfigProvider->createInstanceWithArguments( @@ -537,12 +536,10 @@ bool HierarchyEntry::move( bNewRoot = false; } - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value <<= aOldParentPath; - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, uno::Any(aOldParentPath)} + })); xOldParentBatch.set( m_xConfigProvider->createInstanceWithArguments( @@ -564,14 +561,15 @@ bool HierarchyEntry::move( { bDifferentParents = true; - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value <<= aNewParentPath; - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments2(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, uno::Any(aNewParentPath)} + })); xNewParentBatch.set( m_xConfigProvider->createInstanceWithArguments( READWRITE_SERVICE_NAME, - aArguments ), + aArguments2 ), uno::UNO_QUERY ); OSL_ENSURE( @@ -787,12 +785,10 @@ bool HierarchyEntry::remove() bRoot = false; } - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value <<= aParentPath; - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, uno::Any(aParentPath)} + })); uno::Reference< util::XChangesBatch > xBatch( m_xConfigProvider->createInstanceWithArguments( @@ -1021,11 +1017,10 @@ HierarchyEntry::getRootReadAccess() { // Create Root object. - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name = CFGPROPERTY_NODEPATH; - aProperty.Value <<= OUString(); // root path - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {CFGPROPERTY_NODEPATH, uno::Any(OUString())} // root path + })); m_bTriedToGetRootReadAccess = true; diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 7550d7eef252..b49a398357c8 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -63,6 +63,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/propertyvalueset.hxx> #include <ucbhelper/cancelcommandexecution.hxx> @@ -522,17 +523,13 @@ uno::Any SAL_CALL Content::execute( // Remove own and all children's persistent data. if ( !removeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, Environment, "Cannot remove persistent data!", this ); @@ -594,17 +591,13 @@ uno::Any SAL_CALL Content::execute( if( !flushData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, Environment, "Cannot write file to disk!", this ); @@ -1333,17 +1326,13 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { if ( !storeData( uno::Reference< io::XInputStream >() ) ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot store persistent data!", this ); @@ -1404,17 +1393,13 @@ uno::Any Content::open( if ( !xIn.is() ) { // No interaction if we are not persistent! - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, m_eState == PERSISTENT ? xEnv : uno::Reference< ucb::XCommandEnvironment >(), @@ -1462,17 +1447,13 @@ uno::Any Content::open( if ( !xIn.is() ) { // No interaction if we are not persistent! - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, m_eState == PERSISTENT ? xEnv : uno::Reference< @@ -1631,16 +1612,13 @@ void Content::insert( if ( !storeData( xStream ) ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot store persistent data!", this ); @@ -1747,15 +1725,13 @@ void Content::transfer( { if ( aId.startsWith( rInfo.SourceURL ) ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(rInfo.SourceURL), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_RECURSIVE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Target is equal to or is a child of source!", this ); @@ -1786,15 +1762,13 @@ void Content::transfer( if ( !xSource.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(xId->getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(xId->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot instantiate source object!", this ); @@ -1818,15 +1792,13 @@ void Content::transfer( = static_cast< Content * >( createNewContent( aContentInfo ).get() ); if ( !xTarget.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Folder", - -1, - uno::makeAny(aId), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Folder", uno::Any(aId)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "XContentCreator::createNewContent failed!", this ); @@ -1974,18 +1946,13 @@ void Content::transfer( // Remove all persistent data of source and its children. if ( !xSource->removeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( - xSource->m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(xSource->m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot remove persistent data of source object!", this ); diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 5ee0acf192a1..4d9df9b27b85 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -62,6 +62,7 @@ #include "com/sun/star/ucb/XPersistentPropertySet.hpp" #include "comphelper/processfactory.hxx" +#include <comphelper/propertysequence.hxx> #include "ucbhelper/cancelcommandexecution.hxx" #include "ucbhelper/contentidentifier.hxx" #include "ucbhelper/propertyvalueset.hxx" @@ -491,17 +492,13 @@ uno::Any SAL_CALL Content::execute( // Remove own and all children's persistent data. if ( !removeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, Environment, "Cannot remove persistent data!", this ); @@ -1305,17 +1302,13 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { if ( !storeData( uno::Reference< io::XInputStream >(), xEnv ) ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot store persistent data!", this ); @@ -1379,17 +1372,13 @@ uno::Any Content::open( if ( !xStream.is() ) { // No interaction if we are not persistent! - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, m_eState == PERSISTENT ? xEnv : uno::Reference< ucb::XCommandEnvironment >(), @@ -1413,17 +1402,13 @@ uno::Any Content::open( if ( !xIn.is() ) { // No interaction if we are not persistent! - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, m_eState == PERSISTENT ? xEnv : uno::Reference< ucb::XCommandEnvironment >(), @@ -1473,17 +1458,13 @@ uno::Any Content::open( if ( !xIn.is() ) { // No interaction if we are not persistent! - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, m_eState == PERSISTENT ? xEnv : uno::Reference< @@ -1657,16 +1638,13 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( !storeData( xData, xEnv ) ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny(m_xIdentifier-> - getContentIdentifier()), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(m_xIdentifier->getContentIdentifier())} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot store persistent data!", this ); @@ -1914,15 +1892,13 @@ void Content::transfer( { if ( aId.startsWith( rInfo.SourceURL ) ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny( rInfo.SourceURL ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_RECURSIVE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Target is equal to or is a child of source!", this ); @@ -1992,16 +1968,13 @@ void Content::transfer( if ( !copyData( aSourceUri, aNewName ) ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( rInfo.SourceURL ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot copy data!", this ); @@ -2023,16 +1996,13 @@ void Content::transfer( if ( !copyAdditionalPropertySet( aSourceUri.getUri(), aTargetUri ) ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( rInfo.SourceURL ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot copy additional properties!", this ); @@ -2062,15 +2032,13 @@ void Content::transfer( if ( !xTarget.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny( aTargetUri ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(aTargetUri)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot instantiate target object!", this ); @@ -2104,15 +2072,13 @@ void Content::transfer( if ( !xSource.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( - "Uri", - -1, - uno::makeAny( rInfo.SourceURL ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_READ, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot instantiate target object!", this ); @@ -2125,16 +2091,13 @@ void Content::transfer( // Remove all persistent data of source and its children. if ( !xSource->removeData() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( rInfo.SourceURL ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot remove persistent data of source object!", this ); @@ -2144,16 +2107,13 @@ void Content::transfer( // Remove own and all children's Additional Core Properties. if ( !xSource->removeAdditionalPropertySet() ) { - uno::Any aProps - = uno::makeAny( - beans::PropertyValue( - "Uri", - -1, - uno::makeAny( rInfo.SourceURL ), - beans::PropertyState_DIRECT_VALUE)); + uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"Uri", uno::Any(rInfo.SourceURL)} + })); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_WRITE, - uno::Sequence< uno::Any >(&aProps, 1), + aArgs, xEnv, "Cannot remove additional properties of source object!", this ); diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 8d432e9b7c20..84f48885e7af 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> +#include <comphelper/propertysequence.hxx> #include <unotools/configpaths.hxx> #include <unotools/syslocale.hxx> #include <rtl/ustrbuf.hxx> @@ -102,11 +103,10 @@ DefaultFontConfiguration::DefaultFontConfiguration() { // get service provider m_xConfigProvider = theDefaultProvider::get(comphelper::getProcessComponentContext()); - Sequence< Any > aArgs(1); - PropertyValue aVal; - aVal.Name = "nodepath"; - aVal.Value <<= OUString( "/org.openoffice.VCL/DefaultFonts" ); - aArgs.getArray()[0] <<= aVal; + Sequence<Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", Any(OUString( "/org.openoffice.VCL/DefaultFonts" ))} + })); m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", @@ -355,11 +355,10 @@ FontSubstConfiguration::FontSubstConfiguration() : Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); // create configuration hierarchical access name m_xConfigProvider = theDefaultProvider::get( xContext ); - Sequence< Any > aArgs(1); - PropertyValue aVal; - aVal.Name = "nodepath"; - aVal.Value <<= OUString( "/org.openoffice.VCL/FontSubstitutions" ); - aArgs.getArray()[0] <<= aVal; + Sequence<Any> aArgs(comphelper::InitAnyPropertySequence( + { + {"nodepath", Any(OUString( "/org.openoffice.VCL/FontSubstitutions" ))} + })); m_xConfigAccess = Reference< XNameAccess >( m_xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 1e0f4b91b609..b397d52b7a97 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -66,6 +66,7 @@ #include <osl/thread.hxx> #include <tools/diagnose_ex.h> #include <comphelper/documentconstants.hxx> +#include <comphelper/propertysequence.hxx> #include <svtools/sfxecode.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> @@ -857,11 +858,10 @@ UUIInteractionHelper::getInteractionHandlerList( aFullPath.append( "/org.openoffice.ucb.InteractionHandler/InteractionHandlers" ); - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name = "nodepath"; - aProperty.Value <<= aFullPath.makeStringAndClear(); - aArguments[ 0 ] <<= aProperty; + uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(aFullPath.makeStringAndClear())} + })); uno::Reference< uno::XInterface > xInterface( xConfigProv->createInstanceWithArguments( diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 0deeea6217d7..27a61b238da6 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/i18n/Collator.hpp> +#include <comphelper/propertysequence.hxx> #include "inputstream.hxx" #include <algorithm> #include <cassert> @@ -200,11 +201,10 @@ OString Databases::getImageTheme() configuration::theDefaultProvider::get(m_xContext); // set root path - uno::Sequence < uno::Any > lParams(1); - beans::PropertyValue aParam ; - aParam.Name = "nodepath"; - aParam.Value <<= OUString("org.openoffice.Office.Common"); - lParams[0] <<= aParam; + uno::Sequence<uno::Any> lParams(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("org.openoffice.Office.Common"))} + })); // open it uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments( diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx index 5e0ff8832ebf..bd685d19dab2 100644 --- a/xmlhelp/source/treeview/tvfactory.cxx +++ b/xmlhelp/source/treeview/tvfactory.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include "tvfactory.hxx" #include "tvread.hxx" @@ -66,15 +67,12 @@ Reference< XInterface > SAL_CALL TVFactory::createInstance( const OUString& aServiceSpecifier ) { - Sequence< Any > seq( 1 ); - seq[0] <<= PropertyValue( - "nodepath", - -1, - Any( OUString() ), - PropertyState_DIRECT_VALUE ); - - return createInstanceWithArguments( aServiceSpecifier, - seq ); + uno::Sequence<uno::Any> seq(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString())} + })); + + return createInstanceWithArguments( aServiceSpecifier, seq ); } Reference< XInterface > SAL_CALL diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 4e726a2bf2b6..424ec3029ada 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/deployment/thePackageManagerFactory.hpp> #include <com/sun/star/util/theMacroExpander.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp> @@ -614,11 +615,10 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) { Reference< lang::XMultiServiceFactory > xConfigProvider = theDefaultProvider::get( xContext ); - uno::Sequence < uno::Any > lParams(1); - beans::PropertyValue aParam ; - aParam.Name = "nodepath"; - aParam.Value <<= OUString("/org.openoffice.Setup/Product"); - lParams[0] <<= aParam; + uno::Sequence<uno::Any> lParams(comphelper::InitAnyPropertySequence( + { + {"nodepath", uno::Any(OUString("/org.openoffice.Setup/Product"))} + })); // open it uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments( |