diff options
author | Stephan Bergmann <sb@openoffice.org> | 2001-08-29 12:38:57 +0000 |
---|---|---|
committer | Stephan Bergmann <sb@openoffice.org> | 2001-08-29 12:38:57 +0000 |
commit | 3838845c0548c0e1f795e451d531496037dcd57c (patch) | |
tree | 65d84f49b11b849a809e9ece9d50e6e57a06ad68 /ucb/source/ucp/package/pkgcontent.cxx | |
parent | c58455a5eb653bcd5ea5f420b724617229e137ce (diff) |
#91676# Removed obsolete versions of cancelCommandExecution().
Diffstat (limited to 'ucb/source/ucp/package/pkgcontent.cxx')
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.cxx | 205 |
1 files changed, 146 insertions, 59 deletions
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 38ce218de857..7e57436f88ca 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pkgcontent.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: kso $ $Date: 2001-07-06 09:32:34 $ + * last change: $Author: sb $ $Date: 2001-08-29 13:38:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,10 +67,22 @@ #ifndef _OSL_DIAGNOSE_H_ #include <osl/diagnose.h> #endif +#ifndef _RTL_USTRING_H_ +#include <rtl/ustring.h> +#endif +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_ +#include <com/sun/star/beans/PropertyState.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_ #include <com/sun/star/beans/XPropertyAccess.hpp> #endif @@ -146,6 +158,12 @@ #ifndef _COM_SUN_STAR_UTIL_XCHANGESBATCH_HPP_ #include <com/sun/star/util/XChangesBatch.hpp> #endif +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include <com/sun/star/uno/Any.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif #ifndef _UCBHELPER_CONTENTIDENTIFIER_HXX #include <ucbhelper/contentidentifier.hxx> #endif @@ -633,12 +651,21 @@ uno::Any SAL_CALL Content::execute( if ( !removeData() ) { ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_WRITE, - m_xIdentifier->getContentIdentifier(), - Environment, - rtl::OUString::createFromAscii( - "Cannot remove persistent data!" ), - this ); + star::ucb::IOErrorCode_CANT_WRITE, + uno::Sequence< uno::Any >( + &uno::makeAny( + beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + -1, + uno::makeAny(m_xIdentifier-> + getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), + Environment, + rtl::OUString::createFromAscii( + "Cannot remove persistent data!" ), + this ); // Unreachable } @@ -1522,12 +1549,21 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( !storeData( uno::Reference< io::XInputStream >() ) ) { ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_WRITE, - m_xIdentifier->getContentIdentifier(), - xEnv, - rtl::OUString::createFromAscii( - "Cannot store persistent data!" ), - this ); + star::ucb::IOErrorCode_CANT_WRITE, + uno::Sequence< uno::Any >( + &uno::makeAny( + beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + -1, + uno::makeAny(m_xIdentifier-> + getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), + xEnv, + rtl::OUString::createFromAscii( + "Cannot store persistent data!" ), + this ); // Unreachable } } @@ -1587,7 +1623,16 @@ uno::Any Content::open( // No interaction if we are not persistent! ucbhelper::cancelCommandExecution( star::ucb::IOErrorCode_CANT_READ, - m_xIdentifier->getContentIdentifier(), + uno::Sequence< uno::Any >( + &uno::makeAny( + beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + -1, + uno::makeAny(m_xIdentifier-> + getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), m_eState == PERSISTENT ? xEnv : uno::Reference< star::ucb::XCommandEnvironment >(), @@ -1637,15 +1682,24 @@ uno::Any Content::open( { // No interaction if we are not persistent! ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_READ, - m_xIdentifier->getContentIdentifier(), - m_eState == PERSISTENT - ? xEnv - : uno::Reference< - star::ucb::XCommandEnvironment >(), - rtl::OUString::createFromAscii( - "Got no data stream!" ), - this ); + star::ucb::IOErrorCode_CANT_READ, + uno::Sequence< uno::Any >( + &uno::makeAny( + beans::PropertyValue( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Uri")), + -1, + uno::makeAny(m_xIdentifier-> + getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), + m_eState == PERSISTENT + ? xEnv + : uno::Reference< + star::ucb::XCommandEnvironment >(), + rtl::OUString::createFromAscii( + "Got no data stream!" ), + this ); // Unreachable } @@ -1800,12 +1854,19 @@ void Content::insert( if ( !storeData( xStream ) ) { ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_WRITE, - m_xIdentifier->getContentIdentifier(), - xEnv, - rtl::OUString::createFromAscii( - "Cannot store persistent data!" ), - this ); + star::ucb::IOErrorCode_CANT_WRITE, + uno::Sequence< uno::Any >( + &uno::makeAny(beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + -1, + uno::makeAny(m_xIdentifier-> + getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), + xEnv, + rtl::OUString::createFromAscii( "Cannot store persistent data!" ), + this ); // Unreachable } @@ -1913,17 +1974,20 @@ void Content::transfer( if ( aId.compareTo( rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) { - uno::Sequence< uno::Any > aArgs( 2 ); - aArgs[ 0 ] <<= rInfo.SourceURL; - aArgs[ 1 ] <<= aId; - ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_RECURSIVE, - aArgs, - xEnv, - rtl::OUString::createFromAscii( - "Target is equal to or is a child of source!" ), - this ); + star::ucb::IOErrorCode_RECURSIVE, + uno::Sequence< uno::Any >( + &uno::makeAny(beans::PropertyValue( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Uri")), + -1, + uno::makeAny(rInfo.SourceURL), + beans::PropertyState_DIRECT_VALUE)), + 1), + xEnv, + rtl::OUString::createFromAscii( + "Target is equal to or is a child of source!" ), + this ); // Unreachable } } @@ -1952,12 +2016,19 @@ void Content::transfer( if ( !xSource.is() ) { ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_READ, - xId->getContentIdentifier(), - xEnv, - rtl::OUString::createFromAscii( - "Cannot instanciate source object!" ), - this ); + star::ucb::IOErrorCode_CANT_READ, + uno::Sequence< uno::Any >( + &uno::makeAny(beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + -1, + uno::makeAny(xId->getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), + xEnv, + rtl::OUString::createFromAscii( + "Cannot instanciate source object!" ), + this ); // Unreachable } @@ -1979,13 +2050,19 @@ void Content::transfer( if ( !xTarget.is() ) { ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_CREATE, - rtl::OUString(), // new URL - aId, - xEnv, - rtl::OUString::createFromAscii( - "XContentCreator::createNewContent failed!" ), - this ); + star::ucb::IOErrorCode_CANT_CREATE, + uno::Sequence< uno::Any >( + &uno::makeAny(beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Folder")), + -1, + uno::makeAny(aId), + beans::PropertyState_DIRECT_VALUE)), + 1), + xEnv, + rtl::OUString::createFromAscii( + "XContentCreator::createNewContent failed!" ), + this ); // Unreachable } @@ -2134,12 +2211,22 @@ void Content::transfer( if ( !xSource->removeData() ) { ucbhelper::cancelCommandExecution( - star::ucb::IOErrorCode_CANT_WRITE, - xSource->m_xIdentifier->getContentIdentifier(), - xEnv, - rtl::OUString::createFromAscii( - "Cannot remove persistent data of source object!" ), - this ); + star::ucb::IOErrorCode_CANT_WRITE, + uno::Sequence< uno::Any >( + &uno::makeAny( + beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + -1, + uno::makeAny( + xSource->m_xIdentifier-> + getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE)), + 1), + xEnv, + rtl::OUString::createFromAscii( + "Cannot remove persistent data of source object!" ), + this ); // Unreachable } |