dbaccess/source/core/dataaccess/ContentHelper.cxx | 16 - dbaccess/source/core/dataaccess/documentcontainer.cxx | 12 - dbaccess/source/core/dataaccess/documentdefinition.cxx | 16 - include/ucbhelper/cancelcommandexecution.hxx | 2 ucb/source/core/ucb.cxx | 12 - ucb/source/core/ucbcmds.cxx | 25 +- ucb/source/ucp/cmis/cmis_content.cxx | 70 +++---- ucb/source/ucp/cmis/cmis_content.hxx | 2 ucb/source/ucp/cmis/cmis_repo_content.cxx | 6 ucb/source/ucp/cmis/cmis_repo_content.hxx | 2 ucb/source/ucp/ext/ucpext_content.cxx | 20 +- ucb/source/ucp/file/filglob.cxx | 42 ++-- ucb/source/ucp/ftp/ftpcontent.cxx | 104 ++++------ ucb/source/ucp/gio/gio_content.cxx | 165 +++++++---------- ucb/source/ucp/gio/gio_content.hxx | 6 ucb/source/ucp/hierarchy/hierarchycontent.cxx | 67 +++--- ucb/source/ucp/package/pkgcontent.cxx | 73 +++---- ucb/source/ucp/tdoc/tdoc_content.cxx | 109 +++++------ ucb/source/ucp/webdav-neon/webdavcontent.cxx | 153 +++++++-------- ucb/source/ucp/webdav-neon/webdavcontent.hxx | 2 ucb/source/ucp/webdav/webdavcontent.cxx | 4 ucb/source/ucp/webdav/webdavcontent.hxx | 2 ucbhelper/source/client/content.cxx | 12 - ucbhelper/source/provider/cancelcommandexecution.cxx | 8 xmlhelp/source/cxxhelp/provider/content.cxx | 15 - 25 files changed, 437 insertions(+), 508 deletions(-)
New commits: commit 4739b31dafc5154a2c7d6b3f0ee90686863656f0 Author: Noel Grandin <[email protected]> Date: Sun Jan 29 11:57:08 2017 +0200 cancelCommandExecution - no need to pass exception by Any all the call sites are passing an uno::Exception subtype Change-Id: I6de1f00810e063e75ef620314561d7e2d6445ada Reviewed-on: https://gerrit.libreoffice.org/33657 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index 4eea9fe..7de44a4 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -165,10 +165,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -183,10 +183,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -195,10 +195,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma { OSL_FAIL( "No properties!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -221,9 +221,9 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma OSL_FAIL( "Content::execute - unsupported command!" ); ucbhelper::cancelCommandExecution( - makeAny( UnsupportedCommandException( + UnsupportedCommandException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), Environment ); // Unreachable } diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index c7ddcb6..d8a14c8 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -402,10 +402,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -429,10 +429,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com { // Unsupported. ucbhelper::cancelCommandExecution( - makeAny( UnsupportedOpenModeException( + UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( aOpenCommand.Mode ) ) ), + sal_Int16( aOpenCommand.Mode ) ), Environment ); // Unreachable } @@ -446,10 +446,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 8818e68..29c531c 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -883,10 +883,10 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons { // not supported ucbhelper::cancelCommandExecution( - makeAny( UnsupportedOpenModeException( + UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( nOpenMode ) ) ), + sal_Int16( nOpenMode ) ), _rxEnvironment ); // Unreachable OSL_FAIL( "unreachable" ); @@ -1018,10 +1018,10 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -1044,10 +1044,10 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co { OSL_FAIL( "Wrong argument count!" ); ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -1161,10 +1161,10 @@ void ODocumentDefinition::onCommandInsert( const OUString& _sURL, const Referenc Sequence<OUString> aProps { PROPERTY_URL }; ucbhelper::cancelCommandExecution( - makeAny( MissingPropertiesException( + MissingPropertiesException( OUString(), static_cast< cppu::OWeakObject * >( this ), - aProps ) ), + aProps ), Environment ); // Unreachable } diff --git a/include/ucbhelper/cancelcommandexecution.hxx b/include/ucbhelper/cancelcommandexecution.hxx index 381d63c..95c78c2 100644 --- a/include/ucbhelper/cancelcommandexecution.hxx +++ b/include/ucbhelper/cancelcommandexecution.hxx @@ -53,7 +53,7 @@ namespace ucbhelper @throws css::uno::Exception */ -UCBHELPER_DLLPUBLIC void cancelCommandExecution( const css::uno::Any & rException, +UCBHELPER_DLLPUBLIC void cancelCommandExecution( const css::uno::Exception & rException, const css::uno::Reference< css::ucb::XCommandEnvironment > & xEnv ); diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index d363044..9449061 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -637,10 +637,10 @@ Any SAL_CALL UniversalContentBroker::execute( if ( !( aCommand.Argument >>= aArg ) ) { ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -661,10 +661,10 @@ Any SAL_CALL UniversalContentBroker::execute( if ( !( aCommand.Argument >>= aCheckinArg ) ) { ucbhelper::cancelCommandExecution( - makeAny( IllegalArgumentException( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -677,9 +677,9 @@ Any SAL_CALL UniversalContentBroker::execute( ucbhelper::cancelCommandExecution( - makeAny( UnsupportedCommandException( + UnsupportedCommandException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), Environment ); // Unreachable } diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 988efa3..20fa1c5 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -640,10 +640,10 @@ uno::Reference< ucb::XContent > createNew( else { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Unknown transfer operation!", rContext.xProcessor, - -1 ) ), + -1 ), rContext.xOrigEnv ); // Unreachable } @@ -1027,9 +1027,9 @@ void handleNameClashRename( if ( aOldTitle.isEmpty() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( beans::UnknownPropertyException( + beans::UnknownPropertyException( "Unable to get property 'Title' from new object!", - rContext.xProcessor ) ), + rContext.xProcessor ), rContext.xOrigEnv ); // Unreachable } @@ -1141,11 +1141,10 @@ void handleNameClashRename( if ( nTry == 50 ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedNameClashException( "Unable to resolve name clash!", rContext.xProcessor, - ucb::NameClash::RENAME ) ), + ucb::NameClash::RENAME ), rContext.xOrigEnv ); // Unreachable } @@ -1163,9 +1162,9 @@ void globalTransfer_( if ( !bSourceIsFolder && xSourceProps->wasNull() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( beans::UnknownPropertyException( + beans::UnknownPropertyException( "Unable to get property 'IsFolder' from source object!", - rContext.xProcessor ) ), + rContext.xProcessor ), rContext.xOrigEnv ); // Unreachable } @@ -1175,9 +1174,9 @@ void globalTransfer_( if ( !bSourceIsDocument && xSourceProps->wasNull() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( beans::UnknownPropertyException( + beans::UnknownPropertyException( "Unable to get property 'IsDocument' from source object!", - rContext.xProcessor ) ), + rContext.xProcessor ), rContext.xOrigEnv ); // Unreachable } @@ -1361,12 +1360,11 @@ void globalTransfer_( case ucb::NameClash::OVERWRITE: { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedNameClashException( "BUG: insert + replace == true MUST NOT " "throw NameClashException.", rContext.xProcessor, - rContext.aArg.NameClash ) ), + rContext.aArg.NameClash ), rContext.xOrigEnv ); SAL_FALLTHROUGH; // Unreachable } @@ -1457,12 +1455,11 @@ void globalTransfer_( default: { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedNameClashException( "default action, don't know how to " "handle name clash", rContext.xProcessor, - rContext.aArg.NameClash ) ), + rContext.aArg.NameClash ), rContext.xOrigEnv ); // Unreachable } diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 6818f6d..fbc0e07 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -592,11 +592,11 @@ namespace cmis return bIsFolder; } - uno::Any Content::getBadArgExcept() + lang::IllegalArgumentException Content::getBadArgExcept() { - return uno::makeAny( lang::IllegalArgumentException( + return lang::IllegalArgumentException( "Wrong argument type!", - static_cast< cppu::OWeakObject * >( this ), -1) ); + static_cast< cppu::OWeakObject * >( this ), -1); } libcmis::ObjectPtr Content::updateProperties( @@ -980,13 +980,12 @@ namespace cmis { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); - uno::Any aErr = uno::makeAny( + + ucbhelper::cancelCommandExecution( ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs) - ); - - ucbhelper::cancelCommandExecution(aErr, xEnv); + bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs), + xEnv); } uno::Any aRet; @@ -1011,9 +1010,9 @@ namespace cmis ) { ucbhelper::cancelCommandExecution( - uno::makeAny ( ucb::UnsupportedOpenModeException + ucb::UnsupportedOpenModeException ( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rOpenCommand.Mode ) ) ), + sal_Int16( rOpenCommand.Mode ) ), xEnv ); } @@ -1025,9 +1024,9 @@ namespace cmis SAL_INFO( "ucb.ucp.cmis", "Failed to copy data to sink" ); ucbhelper::cancelCommandExecution( - uno::makeAny (ucb::UnsupportedDataSinkException + ucb::UnsupportedDataSinkException ( OUString(), static_cast< cppu::OWeakObject * >( this ), - rOpenCommand.Sink ) ), + rOpenCommand.Sink ), xEnv ); } } @@ -1270,10 +1269,9 @@ namespace cmis if ( sSrcBindingUrl != m_aURL.getBindingUrl( ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::InteractiveBadTransferURLException( + ucb::InteractiveBadTransferURLException( "Unsupported URL scheme!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } } @@ -1287,9 +1285,9 @@ namespace cmis { if ( !xInputStream.is() ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( ucb::MissingInputStreamException - ( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + ucb::MissingInputStreamException + ( OUString(), static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } @@ -1314,9 +1312,9 @@ namespace cmis map< string, libcmis::PropertyPtr >::iterator it = m_pObjectProps.find( "cmis:name" ); if ( it == m_pObjectProps.end( ) ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( uno::RuntimeException( "Missing name property", - static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + uno::RuntimeException( "Missing name property", + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } string newName = it->second->getStrings( ).front( ); @@ -1342,9 +1340,9 @@ namespace cmis // Are the base type matching? if ( object->getBaseType( ) != m_pObjectType->getBaseType( )->getId() ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( uno::RuntimeException( "Can't change a folder into a document and vice-versa.", - static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + uno::RuntimeException( "Can't change a folder into a document and vice-versa.", + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } @@ -1361,9 +1359,9 @@ namespace cmis } catch ( const libcmis::Exception& ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( uno::RuntimeException( "Error when setting document content", - static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + uno::RuntimeException( "Error when setting document content", + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } } @@ -1383,9 +1381,9 @@ namespace cmis } catch ( const libcmis::Exception& ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( uno::RuntimeException( "Error when creating folder", - static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + uno::RuntimeException( "Error when creating folder", + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } } @@ -1401,9 +1399,9 @@ namespace cmis } catch ( const libcmis::Exception& ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( uno::RuntimeException( "Error when creating document", - static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + uno::RuntimeException( "Error when creating document", + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } } @@ -1885,10 +1883,10 @@ namespace cmis { SAL_INFO( "ucb.ucp.cmis", "Unknown command to execute" ); - ucbhelper::cancelCommandExecution - ( uno::makeAny( ucb::UnsupportedCommandException + ucbhelper::cancelCommandExecution( + ucb::UnsupportedCommandException ( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx index 366b1a4..357845c 100644 --- a/ucb/source/ucp/cmis/cmis_content.hxx +++ b/ucb/source/ucp/cmis/cmis_content.hxx @@ -81,7 +81,7 @@ private: void setCmisProperty(const std::string& rName, const std::string& rValue, const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv ); - css::uno::Any getBadArgExcept(); + css::lang::IllegalArgumentException getBadArgExcept(); css::uno::Reference< css::sdbc::XRow > getPropertyValues( diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx index f130b83..552532b 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.cxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx @@ -69,11 +69,11 @@ namespace cmis { } - uno::Any RepoContent::getBadArgExcept() + lang::IllegalArgumentException RepoContent::getBadArgExcept() { - return uno::makeAny( lang::IllegalArgumentException( + return lang::IllegalArgumentException( "Wrong argument type!", - static_cast< cppu::OWeakObject * >( this ), -1) ); + static_cast< cppu::OWeakObject * >( this ), -1); } uno::Reference< sdbc::XRow > RepoContent::getPropertyValues( diff --git a/ucb/source/ucp/cmis/cmis_repo_content.hxx b/ucb/source/ucp/cmis/cmis_repo_content.hxx index 4be969e..2ce3b5d 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.hxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.hxx @@ -57,7 +57,7 @@ private: private: - css::uno::Any getBadArgExcept(); + css::lang::IllegalArgumentException getBadArgExcept(); css::uno::Reference< css::sdbc::XRow > getPropertyValues( diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index 950a953..562d810 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -191,8 +191,8 @@ namespace ucb { namespace ucp { namespace ext Sequence< Property > Properties; if ( !( aCommand.Argument >>= Properties ) ) { - ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString(), *this, -1 ) ), + ::ucbhelper::cancelCommandExecution( IllegalArgumentException( + OUString(), *this, -1 ), i_rEvironment ); // unreachable } @@ -204,16 +204,16 @@ namespace ucb { namespace ucp { namespace ext Sequence< PropertyValue > aProperties; if ( !( aCommand.Argument >>= aProperties ) ) { - ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString(), *this, -1 ) ), + ::ucbhelper::cancelCommandExecution( IllegalArgumentException( + OUString(), *this, -1 ), i_rEvironment ); // unreachable } if ( !aProperties.getLength() ) { - ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString(), *this, -1 ) ), + ::ucbhelper::cancelCommandExecution( IllegalArgumentException( + OUString(), *this, -1 ), i_rEvironment ); // unreachable } @@ -235,8 +235,8 @@ namespace ucb { namespace ucp { namespace ext OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { - ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString(), *this, -1 ) ), + ::ucbhelper::cancelCommandExecution( IllegalArgumentException( + OUString(), *this, -1 ), i_rEvironment ); // unreachable } @@ -263,8 +263,8 @@ namespace ucb { namespace ucp { namespace ext else { - ::ucbhelper::cancelCommandExecution( makeAny( UnsupportedCommandException( - OUString(), *this ) ), + ::ucbhelper::cancelCommandExecution( UnsupportedCommandException( + OUString(), *this ), i_rEvironment ); // unreachable } diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 32010eb..782407b 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -245,13 +245,11 @@ namespace fileaccess { bool isHandled ) { Reference<XCommandProcessor> xComProc(pContent); - Any aAny; IOErrorCode ioErrorCode; if( errorCode == TASKHANDLER_UNSUPPORTED_COMMAND ) { - aAny <<= UnsupportedCommandException( OSL_LOG_PREFIX ); - cancelCommandExecution( aAny,xEnv ); + cancelCommandExecution( UnsupportedCommandException( OSL_LOG_PREFIX ), xEnv ); } else if( errorCode == TASKHANDLING_WRONG_SETPROPERTYVALUES_ARGUMENT || errorCode == TASKHANDLING_WRONG_GETPROPERTYVALUES_ARGUMENT || @@ -263,13 +261,13 @@ namespace fileaccess { { IllegalArgumentException excep; excep.ArgumentPosition = 0; - cancelCommandExecution(Any(excep), xEnv); + cancelCommandExecution(excep, xEnv); } else if( errorCode == TASKHANDLING_UNSUPPORTED_OPEN_MODE ) { UnsupportedOpenModeException excep; excep.Mode = sal::static_int_cast< sal_Int16 >(minorCode); - cancelCommandExecution( Any(excep),xEnv ); + cancelCommandExecution( excep,xEnv ); } else if(errorCode == TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND || errorCode == TASKHANDLING_INSERTED_STATE_IN_OPEN_COMMAND || @@ -505,11 +503,12 @@ namespace fileaccess { OUString("Title") : OUString("ContentType"); - aAny <<= MissingPropertiesException( - "a property is missing, necessary to create a content", - xComProc, - aSeq); - cancelCommandExecution(aAny,xEnv); + cancelCommandExecution( + MissingPropertiesException( + "a property is missing, necessary to create a content", + xComProc, + aSeq), + xEnv); } else if( errorCode == TASKHANDLING_FILESIZE_FOR_WRITE ) { @@ -535,11 +534,11 @@ namespace fileaccess { } else if(errorCode == TASKHANDLING_INPUTSTREAM_FOR_WRITE) { - aAny <<= + cancelCommandExecution( MissingInputStreamException( "the inputstream is missing, necessary to create a content", - xComProc); - cancelCommandExecution(aAny,xEnv); + xComProc), + xEnv); } else if( errorCode == TASKHANDLING_NOREPLACE_FOR_WRITE ) // Overwrite = false and file exists @@ -549,7 +548,7 @@ namespace fileaccess { excep.Classification = InteractionClassification_ERROR; excep.Context = Reference<XInterface>( xComProc, UNO_QUERY ); excep.Message = "file exists and overwrite forbidden"; - cancelCommandExecution( Any(excep), xEnv ); + cancelCommandExecution( excep, xEnv ); } else if( errorCode == TASKHANDLING_INVALID_NAME_MKDIR ) { @@ -573,7 +572,7 @@ namespace fileaccess { if(isHandled) throw excep; else { - cancelCommandExecution( Any(excep), xEnv ); + cancelCommandExecution( excep, xEnv ); } // ioErrorCode = IOErrorCode_INVALID_CHARACTER; // cancelCommandExecution( @@ -593,7 +592,7 @@ namespace fileaccess { if(isHandled) throw excep; else { - cancelCommandExecution( Any(excep), xEnv ); + cancelCommandExecution( excep, xEnv ); } // ioErrorCode = IOErrorCode_ALREADY_EXISTING; // cancelCommandExecution( @@ -779,10 +778,11 @@ namespace fileaccess { } else if( errorCode == TASKHANDLING_TRANSFER_INVALIDSCHEME ) { - aAny <<= InteractiveBadTransferURLException( + cancelCommandExecution( + InteractiveBadTransferURLException( "bad transfer url", - xComProc); - cancelCommandExecution( aAny,xEnv ); + xComProc), + xEnv ); } else if( errorCode == TASKHANDLING_OVERWRITE_FOR_MOVE || errorCode == TASKHANDLING_OVERWRITE_FOR_COPY || @@ -845,7 +845,7 @@ namespace fileaccess { excep.Context = Reference<XInterface>( xComProc, UNO_QUERY ); excep.Message = "name clash during copy or move"; - cancelCommandExecution(Any(excep), xEnv); + cancelCommandExecution(excep, xEnv); } else if( errorCode == TASKHANDLING_NAMECLASHSUPPORT_FOR_MOVE || errorCode == TASKHANDLING_NAMECLASHSUPPORT_FOR_COPY ) @@ -855,7 +855,7 @@ namespace fileaccess { excep.Context = Reference<XInterface>( xComProc, UNO_QUERY ); excep.Message = "name clash value not supported during copy or move"; - cancelCommandExecution(Any(excep), xEnv); + cancelCommandExecution(excep, xEnv); } else { diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 6fcea52..846a612 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -296,21 +296,6 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, aRet = p->getRequest(); } -// if(aCommand.Name.equalsAscii( -// "getPropertyValues") && -// action != NOACTION) { -// // It is not allowed to throw if -// // command is getPropertyValues -// rtl::Reference<ucbhelper::PropertyValueSet> xRow = -// new ucbhelper::PropertyValueSet(m_xSMgr); -// Sequence<Property> Properties; -// aCommand.Argument >>= Properties; -// for(int i = 0; i < Properties.getLength(); ++i) -// xRow->appendVoid(Properties[i]); -// aRet <<= Reference<XRow>(xRow.get()); -// return aRet; -// } - switch (action) { case NOACTION: @@ -318,7 +303,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, case THROWAUTHENTICATIONREQUEST: ucbhelper::cancelCommandExecution( - aRet, + aRet.get<css::uno::Exception>(), Reference<XCommandEnvironment>(nullptr)); break; @@ -341,9 +326,8 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { InteractiveNetworkConnectException excep; excep.Server = m_aFTPURL.host(); - aRet <<= excep; ucbhelper::cancelCommandExecution( - aRet, + excep, Environment); break; } @@ -351,9 +335,8 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { InteractiveNetworkResolveNameException excep; excep.Server = m_aFTPURL.host(); - aRet <<= excep; ucbhelper::cancelCommandExecution( - aRet, + excep, Environment); break; } @@ -385,11 +368,12 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, Sequence<Property> Properties; if(!(aCommand.Argument >>= Properties)) { - aRet <<= IllegalArgumentException( + ucbhelper::cancelCommandExecution( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1); - ucbhelper::cancelCommandExecution(aRet,Environment); + -1), + Environment); } aRet <<= getPropertyValues(Properties,Environment); @@ -399,11 +383,12 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, Sequence<PropertyValue> propertyValues; if( ! ( aCommand.Argument >>= propertyValues ) ) { - aRet <<= IllegalArgumentException( + ucbhelper::cancelCommandExecution( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1); - ucbhelper::cancelCommandExecution(aRet,Environment); + -1), + Environment); } aRet <<= setPropertyValues(propertyValues); @@ -420,11 +405,12 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { - aRet <<= IllegalArgumentException( + ucbhelper::cancelCommandExecution( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1); - ucbhelper::cancelCommandExecution(aRet,Environment); + -1), + Environment); } insert(aInsertArgument,Environment); } @@ -435,12 +421,12 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, else if(aCommand.Name == "open") { OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { - aRet <<= IllegalArgumentException( + ucbhelper::cancelCommandExecution( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1); - - ucbhelper::cancelCommandExecution(aRet,Environment); + -1), + Environment); } if(aOpenCommand.Mode == OpenMode::DOCUMENT) { @@ -491,11 +477,12 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, } } else { - aRet <<= UnsupportedDataSinkException( - OUString(), - static_cast< cppu::OWeakObject * >(this), - aOpenCommand.Sink); - ucbhelper::cancelCommandExecution(aRet,Environment); + ucbhelper::cancelCommandExecution( + UnsupportedDataSinkException( + OUString(), + static_cast< cppu::OWeakObject * >(this), + aOpenCommand.Sink), + Environment); } } else if(aOpenCommand.Mode == OpenMode::ALL || @@ -518,38 +505,39 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, aOpenCommand.Mode == OpenMode::DOCUMENT_SHARE_DENY_WRITE) { // Unsupported OpenMode - aRet <<= UnsupportedOpenModeException( - OUString(), - static_cast< cppu::OWeakObject * >(this), - static_cast< sal_Int16 >(aOpenCommand.Mode)); - ucbhelper::cancelCommandExecution(aRet,Environment); + ucbhelper::cancelCommandExecution( + UnsupportedOpenModeException( + OUString(), + static_cast< cppu::OWeakObject * >(this), + static_cast< sal_Int16 >(aOpenCommand.Mode)), + Environment); } else { - aRet <<= IllegalArgumentException( + ucbhelper::cancelCommandExecution( + IllegalArgumentException( "Unexpected OpenMode!", static_cast< cppu::OWeakObject * >(this), - -1); - - ucbhelper::cancelCommandExecution(aRet,Environment); + -1), + Environment); } } else if(aCommand.Name == "createNewContent") { ContentInfo aArg; if (!(aCommand.Argument >>= aArg)) { ucbhelper::cancelCommandExecution( - makeAny( - IllegalArgumentException( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1)), + -1), Environment); // Unreachable } aRet <<= createNewContent(aArg); } else { - aRet <<= UnsupportedCommandException( - aCommand.Name, - static_cast< cppu::OWeakObject * >(this)); - ucbhelper::cancelCommandExecution(aRet,Environment); + ucbhelper::cancelCommandExecution( + UnsupportedCommandException( + aCommand.Name, + static_cast< cppu::OWeakObject * >(this)), + Environment); } return aRet; @@ -688,7 +676,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, MissingPropertiesException excep; excep.Properties.realloc(1); excep.Properties[0] = "Title"; - ucbhelper::cancelCommandExecution(Any(excep), Env); + ucbhelper::cancelCommandExecution(excep, Env); } if(m_bInserted && @@ -696,7 +684,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, !aInsertCommand.Data.is()) { MissingInputStreamException excep; - ucbhelper::cancelCommandExecution(Any(excep), Env); + ucbhelper::cancelCommandExecution(excep, Env); } bool bReplace(aInsertCommand.ReplaceExisting); @@ -714,7 +702,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, // Deprecated, not used anymore: NameClashException excep; excep.Name = m_aFTPURL.child(); - ucbhelper::cancelCommandExecution(Any(excep), Env); + ucbhelper::cancelCommandExecution(excep, Env); } else if(e.code() == FOLDER_MIGHT_EXIST_DURING_INSERT || e.code() == FILE_MIGHT_EXIST_DURING_INSERT) { // Interact @@ -726,7 +714,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, excep.NameClash = 0; //NameClash::ERROR; if(!xInt.is()) { - ucbhelper::cancelCommandExecution(Any(excep), Env); + ucbhelper::cancelCommandExecution(excep, Env); } XInteractionRequestImpl request; diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index a6467d5..61d8c0a 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -139,13 +139,13 @@ OUString SAL_CALL Content::getContentType() #define EXCEPT(aExcept) \ do { \ - if (bThrow) throw aExcept;\ - aRet = uno::makeAny( aExcept );\ + aRet.reset(new aExcept); \ + if (bThrow) throw *aRet;\ } while(false) -uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterface >& rContext, bool bThrow) +std::unique_ptr<uno::Exception> convertToException(GError *pError, const uno::Reference< uno::XInterface >& rContext, bool bThrow) { - uno::Any aRet; + std::unique_ptr<uno::Exception> aRet; gint eCode = pError->code; OUString sMessage(pError->message, strlen(pError->message), RTL_TEXTENCODING_UTF8); @@ -160,108 +160,88 @@ uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterfac switch (eCode) { case G_IO_ERROR_FAILED: - { io::IOException aExcept(sMessage, rContext); - EXCEPT(aExcept); } + EXCEPT(io::IOException(sMessage, rContext)); break; case G_IO_ERROR_NOT_MOUNTED: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING_PATH, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING_PATH, aArgs)); break; case G_IO_ERROR_NOT_FOUND: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, aArgs)); break; case G_IO_ERROR_EXISTS: - { ucb::NameClashException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, sName); - EXCEPT(aExcept); } + EXCEPT( ucb::NameClashException(sMessage, rContext, + task::InteractionClassification_ERROR, sName)); break; case G_IO_ERROR_INVALID_ARGUMENT: - { lang::IllegalArgumentException aExcept(sMessage, rContext, -1 ); - EXCEPT(aExcept); } + EXCEPT( lang::IllegalArgumentException(sMessage, rContext, -1 ) ); break; case G_IO_ERROR_PERMISSION_DENIED: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_ACCESS_DENIED, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_ACCESS_DENIED, aArgs)); break; case G_IO_ERROR_IS_DIRECTORY: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs)); break; case G_IO_ERROR_NOT_REGULAR_FILE: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs)); break; case G_IO_ERROR_NOT_DIRECTORY: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_DIRECTORY, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_DIRECTORY, aArgs)); break; case G_IO_ERROR_FILENAME_TOO_LONG: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NAME_TOO_LONG, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NAME_TOO_LONG, aArgs)); break; case G_IO_ERROR_PENDING: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_PENDING, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_PENDING, aArgs)); break; case G_IO_ERROR_CLOSED: case G_IO_ERROR_CANCELLED: case G_IO_ERROR_TOO_MANY_LINKS: case G_IO_ERROR_WRONG_ETAG: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_GENERAL, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_GENERAL, aArgs)); break; case G_IO_ERROR_NOT_SUPPORTED: case G_IO_ERROR_CANT_CREATE_BACKUP: case G_IO_ERROR_WOULD_MERGE: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_SUPPORTED, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_SUPPORTED, aArgs)); break; case G_IO_ERROR_NO_SPACE: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_OUT_OF_DISK_SPACE, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_OUT_OF_DISK_SPACE, aArgs)); break; case G_IO_ERROR_INVALID_FILENAME: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_INVALID_CHARACTER, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_INVALID_CHARACTER, aArgs)); break; case G_IO_ERROR_READ_ONLY: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_WRITE_PROTECTED, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_WRITE_PROTECTED, aArgs)); break; case G_IO_ERROR_TIMED_OUT: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_DEVICE_NOT_READY, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_DEVICE_NOT_READY, aArgs)); break; case G_IO_ERROR_WOULD_RECURSE: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_RECURSIVE, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_RECURSIVE, aArgs)); break; case G_IO_ERROR_BUSY: case G_IO_ERROR_WOULD_BLOCK: - { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_LOCKING_VIOLATION, aArgs); - EXCEPT(aExcept); } + EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_LOCKING_VIOLATION, aArgs)); break; case G_IO_ERROR_HOST_NOT_FOUND: - { ucb::InteractiveNetworkResolveNameException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR, sHost); - EXCEPT(aExcept);} + EXCEPT( ucb::InteractiveNetworkResolveNameException(sMessage, rContext, + task::InteractionClassification_ERROR, sHost)); break; default: case G_IO_ERROR_ALREADY_MOUNTED: @@ -269,9 +249,8 @@ uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterfac case G_IO_ERROR_NOT_SYMBOLIC_LINK: case G_IO_ERROR_NOT_MOUNTABLE_FILE: case G_IO_ERROR_FAILED_HANDLED: - { ucb::InteractiveNetworkGeneralException aExcept(sMessage, rContext, - task::InteractionClassification_ERROR); - EXCEPT(aExcept);} + EXCEPT( ucb::InteractiveNetworkGeneralException(sMessage, rContext, + task::InteractionClassification_ERROR)); break; } return aRet; @@ -300,19 +279,19 @@ void convertToIOException(GError *pError, const uno::Reference< uno::XInterface } } -uno::Any Content::mapGIOError( GError *pError ) +std::unique_ptr<uno::Exception> Content::mapGIOError( GError *pError ) { if (!pError) - return getBadArgExcept(); + return std::unique_ptr<uno::Exception>(new lang::IllegalArgumentException(getBadArgExcept())); return convertToException(pError, static_cast< cppu::OWeakObject * >(this), false); } -uno::Any Content::getBadArgExcept() +lang::IllegalArgumentException Content::getBadArgExcept() { - return uno::makeAny( lang::IllegalArgumentException( + return lang::IllegalArgumentException( "Wrong argument type!", - static_cast< cppu::OWeakObject * >( this ), -1) ); + static_cast< cppu::OWeakObject * >( this ), -1); } class MountOperation @@ -656,7 +635,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { if (!mbTransient) - ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); else { if (pError) @@ -745,7 +724,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ((bOk = doSetFileInfo(pNewInfo))) { for (sal_Int32 i = 0; i < nChanged; ++i) - aRet[ i ] = getBadArgExcept(); + aRet[ i ] = uno::Any(getBadArgExcept()); } } @@ -859,13 +838,11 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); - uno::Any aErr = uno::makeAny( + ucbhelper::cancelCommandExecution( ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs) - ); - - ucbhelper::cancelCommandExecution(aErr, xEnv); + bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs), + xEnv); } uno::Any aRet; @@ -890,10 +867,10 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, ) { ucbhelper::cancelCommandExecution( - uno::makeAny ( ucb::UnsupportedOpenModeException + ucb::UnsupportedOpenModeException ( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rOpenCommand.Mode ) ) ), - xEnv ); + sal_Int16( rOpenCommand.Mode ) ), + xEnv ); } if ( !feedSink( rOpenCommand.Sink, xEnv ) ) @@ -904,10 +881,10 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, SAL_WARN("ucb.ucp.gio", "Failed to load data from '" << m_xIdentifier->getContentIdentifier() << "'"); ucbhelper::cancelCommandExecution( - uno::makeAny (ucb::UnsupportedDataSinkException - ( OUString(), static_cast< cppu::OWeakObject * >( this ), - rOpenCommand.Sink ) ), - xEnv ); + ucb::UnsupportedDataSinkException( + OUString(), static_cast< cppu::OWeakObject * >( this ), + rOpenCommand.Sink ), + xEnv ); } } else @@ -984,7 +961,7 @@ uno::Any SAL_CALL Content::execute( { GError *pError = nullptr; if (!g_file_delete( getGFile(), nullptr, &pError)) - ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); } destroy( bDeletePhysical ); @@ -994,9 +971,9 @@ uno::Any SAL_CALL Content::execute( SAL_WARN("ucb.ucp.gio", "Unknown command " << aCommand.Name << "\n"); ucbhelper::cancelCommandExecution - ( uno::makeAny( ucb::UnsupportedCommandException + ( ucb::UnsupportedCommandException ( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } @@ -1034,15 +1011,15 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream, { SAL_INFO("ucb.ucp.gio", "Make directory"); if( !g_file_make_directory( getGFile(), nullptr, &pError)) - ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); return; } if ( !xInputStream.is() ) { - ucbhelper::cancelCommandExecution( uno::makeAny - ( ucb::MissingInputStreamException - ( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ), + ucbhelper::cancelCommandExecution( + ucb::MissingInputStreamException + ( OUString(), static_cast< cppu::OWeakObject * >( this ) ), xEnv ); } @@ -1050,12 +1027,12 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream, if ( bReplaceExisting ) { if (!(pOutStream = g_file_replace(getGFile(), nullptr, false, G_FILE_CREATE_PRIVATE, nullptr, &pError))) - ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); } else { if (!(pOutStream = g_file_create (getGFile(), G_FILE_CREATE_PRIVATE, nullptr, &pError))) - ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); } uno::Reference < io::XOutputStream > xOutput = new ::gio::OutputStream(pOutStream); @@ -1094,7 +1071,7 @@ void Content::transfer( const ucb::TransferInfo& aTransferInfo, const uno::Refer g_object_unref(pSource); g_object_unref(pDest); if (!bSuccess) - ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); } uno::Sequence< ucb::ContentInfo > Content::queryCreatableContentsInfo( diff --git a/ucb/source/ucp/gio/gio_content.hxx b/ucb/source/ucp/gio/gio_content.hxx index 366eb72..d76de9d 100644 --- a/ucb/source/ucp/gio/gio_content.hxx +++ b/ucb/source/ucp/gio/gio_content.hxx @@ -53,7 +53,7 @@ namespace gio #define GIO_FILE_TYPE "application/vnd.sun.staroffice.gio-file" #define GIO_FOLDER_TYPE "application/vnd.sun.staroffice.gio-folder" -css::uno::Any convertToException(GError *pError, +std::unique_ptr<css::uno::Exception> convertToException(GError *pError, const css::uno::Reference< css::uno::XInterface >& rContext, bool bThrow=true); /// @throws css::io::IOException /// @throws css::uno::RuntimeException @@ -73,8 +73,8 @@ private: GError **ppError=nullptr); bool isFolder(const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv); - css::uno::Any mapGIOError( GError *error ); - css::uno::Any getBadArgExcept(); + std::unique_ptr<css::uno::Exception> mapGIOError( GError *error ); + css::lang::IllegalArgumentException getBadArgExcept(); css::uno::Reference< css::sdbc::XRow > getPropertyValues( diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index db8da99..08be764 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -342,10 +342,10 @@ uno::Any SAL_CALL HierarchyContent::execute( if ( !( aCommand.Argument >>= Properties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -362,10 +362,10 @@ uno::Any SAL_CALL HierarchyContent::execute( if ( !( aCommand.Argument >>= aProperties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -373,10 +373,10 @@ uno::Any SAL_CALL HierarchyContent::execute( if ( !aProperties.getLength() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "No properties!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -409,10 +409,10 @@ uno::Any SAL_CALL HierarchyContent::execute( if ( !( aCommand.Argument >>= aOpenCommand ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -432,10 +432,10 @@ uno::Any SAL_CALL HierarchyContent::execute( if ( !( aCommand.Argument >>= aArg ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -491,10 +491,10 @@ uno::Any SAL_CALL HierarchyContent::execute( { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -513,10 +513,10 @@ uno::Any SAL_CALL HierarchyContent::execute( { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -530,9 +530,9 @@ uno::Any SAL_CALL HierarchyContent::execute( ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), Environment ); // Unreachable } @@ -1357,9 +1357,9 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, if ( m_eKind == ROOT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not supported by root folder!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1369,10 +1369,10 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, { uno::Sequence<OUString> aProps { "Title" }; ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::MissingPropertiesException( + ucb::MissingPropertiesException( OUString(), static_cast< cppu::OWeakObject * >( this ), - aProps ) ), + aProps ), xEnv ); // Unreachable } @@ -1391,12 +1391,11 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, if ( hasData( xId ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_aProps.getTitle() ) ), + m_aProps.getTitle() ), xEnv ); // Unreachable } @@ -1424,11 +1423,10 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, if ( nTry == 1000 ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedNameClashException( "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ) ), + nNameClashResolve ), xEnv ); // Unreachable } @@ -1448,11 +1446,10 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, if ( hasData( xId ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::UnsupportedNameClashException( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ) ), + nNameClashResolve ), xEnv ); // Unreachable } @@ -1506,9 +1503,9 @@ void HierarchyContent::destroy( bool bDeletePhysical, if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1517,9 +1514,9 @@ void HierarchyContent::destroy( bool bDeletePhysical, if ( m_eKind == ROOT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not supported by root folder!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1558,9 +1555,9 @@ void HierarchyContent::transfer( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1569,9 +1566,9 @@ void HierarchyContent::transfer( if ( !rInfo.SourceURL.startsWith( HIERARCHY_URL_SCHEME ":/" ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::InteractiveBadTransferURLException( + ucb::InteractiveBadTransferURLException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 2fe01f0..6f179a8 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -437,10 +437,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= Properties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -457,10 +457,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aProperties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -468,10 +468,10 @@ uno::Any SAL_CALL Content::execute( if ( !aProperties.getLength() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "No properties!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -506,10 +506,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aOpenCommand ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -526,10 +526,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aArg ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -583,10 +583,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aInfo ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -605,10 +605,10 @@ uno::Any SAL_CALL Content::execute( { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -648,9 +648,9 @@ uno::Any SAL_CALL Content::execute( ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), Environment ); // Unreachable } @@ -1418,10 +1418,10 @@ uno::Any Content::open( { // Currently(?) unsupported. ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedOpenModeException( + ucb::UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rArg.Mode ) ) ), + sal_Int16( rArg.Mode ) ), xEnv ); // Unreachable } @@ -1522,11 +1522,10 @@ uno::Any Content::open( // implementation. Support for this type of // sink is optional... ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::UnsupportedDataSinkException( + ucb::UnsupportedDataSinkException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArg.Sink ) ), + rArg.Sink ), xEnv ); // Unreachable } @@ -1559,9 +1558,9 @@ void Content::insert( if ( !xStream.is() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::MissingInputStreamException( + ucb::MissingInputStreamException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1586,11 +1585,11 @@ void Content::insert( if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::NameClashException( + ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_aProps.aTitle ) ), + m_aProps.aTitle ), xEnv ); // Unreachable } @@ -1618,12 +1617,11 @@ void Content::insert( if ( nTry == 1000 ) { ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::UnsupportedNameClashException( + ucb::UnsupportedNameClashException( "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ) ), - xEnv ); + nNameClashResolve ), + xEnv ); // Unreachable } else @@ -1640,11 +1638,10 @@ void Content::insert( if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::UnsupportedNameClashException( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ) ), + nNameClashResolve ), xEnv ); // Unreachable } @@ -1709,9 +1706,9 @@ void Content::destroy( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1750,9 +1747,9 @@ void Content::transfer( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1763,9 +1760,9 @@ void Content::transfer( m_aUri.getUri(), PACKAGE_URL_SCHEME_LENGTH + 3 ) != 0 ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::InteractiveBadTransferURLException( + ucb::InteractiveBadTransferURLException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 39fec06..fdf6331 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -362,10 +362,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= Properties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -382,10 +382,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aProperties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -393,10 +393,10 @@ uno::Any SAL_CALL Content::execute( if ( !aProperties.getLength() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "No properties!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -429,10 +429,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aOpenCommand ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -449,10 +449,10 @@ uno::Any SAL_CALL Content::execute( if ( ( eType != FOLDER ) && ( eType != STREAM ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "insert command only supported by " "folders and streams!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), Environment ); // Unreachable } @@ -464,12 +464,12 @@ uno::Any SAL_CALL Content::execute( if ( aParentUri.isDocument() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "insert command not supported by " "streams that are direct children " "of document root!", static_cast< cppu::OWeakObject * >( - this ) ) ), + this ) ), Environment ); // Unreachable } @@ -479,10 +479,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aArg ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -505,11 +505,11 @@ uno::Any SAL_CALL Content::execute( if ( ( eType != FOLDER ) && ( eType != STREAM ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "delete command only supported by " "folders and streams!", static_cast< cppu::OWeakObject * >( - this ) ) ), + this ) ), Environment ); // Unreachable } @@ -555,11 +555,11 @@ uno::Any SAL_CALL Content::execute( if ( ( eType != FOLDER ) && ( eType != DOCUMENT ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "transfer command only supported " "by folders and documents!", static_cast< cppu::OWeakObject * >( - this ) ) ), + this ) ), Environment ); // Unreachable } @@ -570,10 +570,10 @@ uno::Any SAL_CALL Content::execute( { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -593,12 +593,12 @@ uno::Any SAL_CALL Content::execute( if ( ( eType != FOLDER ) && ( eType != DOCUMENT ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "createNewContent command only " "supported by folders and " "documents!", static_cast< cppu::OWeakObject * >( - this ) ) ), + this ) ), Environment ); // Unreachable } @@ -609,10 +609,10 @@ uno::Any SAL_CALL Content::execute( { OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -626,9 +626,9 @@ uno::Any SAL_CALL Content::execute( ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), Environment ); // Unreachable } @@ -1391,10 +1391,10 @@ uno::Any Content::open( { // Currently(?) unsupported. ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedOpenModeException( + ucb::UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rArg.Mode ) ) ), + sal_Int16( rArg.Mode ) ), xEnv ); // Unreachable } @@ -1530,11 +1530,10 @@ uno::Any Content::open( else { ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::UnsupportedDataSinkException( + ucb::UnsupportedDataSinkException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArg.Sink ) ), + rArg.Sink ), xEnv ); // Unreachable } @@ -1585,9 +1584,9 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( !xData.is() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::MissingInputStreamException( + ucb::MissingInputStreamException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1610,11 +1609,11 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::NameClashException( + ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_aProps.getTitle() ) ), + m_aProps.getTitle() ), xEnv ); // Unreachable } @@ -1642,11 +1641,10 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( nTry == 1000 ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedNameClashException( "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ) ), + nNameClashResolve ), xEnv ); // Unreachable } @@ -1666,11 +1664,10 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( - ucb::UnsupportedNameClashException( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ) ), + nNameClashResolve ), xEnv ); // Unreachable } @@ -1735,9 +1732,9 @@ void Content::destroy( bool bDeletePhysical, if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1874,9 +1871,9 @@ void Content::transfer( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::UnsupportedCommandException( + ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1887,9 +1884,9 @@ void Content::transfer( { // Invalid length (to short). ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::InteractiveBadTransferURLException( + ucb::InteractiveBadTransferURLException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1901,9 +1898,9 @@ void Content::transfer( { // Invalid scheme. ucbhelper::cancelCommandExecution( - uno::makeAny( ucb::InteractiveBadTransferURLException( + ucb::InteractiveBadTransferURLException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + static_cast< cppu::OWeakObject * >( this ) ), xEnv ); // Unreachable } @@ -1913,10 +1910,10 @@ void Content::transfer( if ( !aSourceUri.isValid() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Invalid source URI! Syntax!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), xEnv ); // Unreachable } @@ -1924,10 +1921,10 @@ void Content::transfer( if ( aSourceUri.isRoot() || aSourceUri.isDocument() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Invalid source URI! Must describe a folder or stream!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), xEnv ); // Unreachable } @@ -1975,13 +1972,13 @@ void Content::transfer( if ( xStorage->isStreamElement( aSourceUri.getDecodedName() ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Invalid source URI! " "Streams cannot be created as " "children of document root!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), xEnv ); // Unreachable } @@ -2004,10 +2001,10 @@ void Content::transfer( if ( !bOK ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Invalid source URI! Unable to determine source type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), xEnv ); // Unreachable } diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index c825798..b82ddde 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -39,6 +39,7 @@ #include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> #include <officecfg/Inet.hxx> +#include <o3tl/make_unique.hxx> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/propertyvalueset.hxx> #include <ucbhelper/simpleinteractionrequest.hxx> @@ -507,10 +508,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= Properties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -527,10 +528,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aProperties ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -538,10 +539,10 @@ uno::Any SAL_CALL Content::execute( if ( !aProperties.getLength() ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "No properties!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -578,10 +579,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aTmp ) ) { ucbhelper::cancelCommandExecution( - uno::makeAny( lang::IllegalArgumentException( + lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ) ), + -1 ), Environment ); // Unreachable } @@ -608,10 +609,10 @@ uno::Any SAL_CALL Content::execute( ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
