summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 09:34:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 12:03:17 +0200
commitf74da1315a5b2ec232a66944e41ff90231b383be (patch)
tree60d464c45df3531013642d61cbc8302ac815a1ae /ucb
parent04a6a5d5cdc6889c6f0e41b3df537f59baeee9f9 (diff)
use more comphelper::InitAnyPropertySequence
Found with: git grep -n -A10 'Sequence.*Any' -- *.cxx | grep -B5 -w PropertyValueProvider and: git grep -n 'Sequence.*Any.*( *&' Change-Id: Icb18c98bdd3f8352817e443ff78de5df042859ad Reviewed-on: https://gerrit.libreoffice.org/40389 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/ucb.cxx10
-rw-r--r--ucb/source/core/ucbcmds.cxx224
-rw-r--r--ucb/source/core/ucbstore.cxx26
-rw-r--r--ucb/source/ucp/file/filtask.cxx19
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx23
-rw-r--r--ucb/source/ucp/hierarchy/hierarchycontent.cxx93
-rw-r--r--ucb/source/ucp/hierarchy/hierarchydata.cxx49
-rw-r--r--ucb/source/ucp/package/pkgcontent.cxx135
-rw-r--r--ucb/source/ucp/tdoc/tdoc_content.cxx172
9 files changed, 299 insertions, 452 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;
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 );