diff options
Diffstat (limited to 'ucb/source/core')
-rw-r--r-- | ucb/source/core/ucb.cxx | 10 | ||||
-rw-r--r-- | ucb/source/core/ucbcmds.cxx | 224 | ||||
-rw-r--r-- | ucb/source/core/ucbstore.cxx | 26 |
3 files changed, 106 insertions, 154 deletions
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; |