summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/hierarchy/hierarchycontent.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/hierarchy/hierarchycontent.cxx')
-rw-r--r--ucb/source/ucp/hierarchy/hierarchycontent.cxx93
1 files changed, 36 insertions, 57 deletions
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 );