diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 15:20:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 15:20:53 +0200 |
commit | 88dde756eb18d4b65283008b940aa432f6146e50 (patch) | |
tree | 20dee3f3861a22e802410675d35855734a7f9db2 /ucb | |
parent | 52885c7b82e6cfdd9072af2dc597edcb31192e89 (diff) |
Revert "cancelCommandExecution - no need to pass exception by Any"
This reverts commit 4739b31dafc5154a2c7d6b3f0ee90686863656f0.
Apparently, passing a param of type css::uno::Exception to Any
will record precisely a css::uno::Exception in that Any, losing
any subtype information, which this commit changed.
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/ucb.cxx | 12 | ||||
-rw-r--r-- | ucb/source/core/ucbcmds.cxx | 25 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 70 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_repo_content.cxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_repo_content.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_content.cxx | 20 | ||||
-rw-r--r-- | ucb/source/ucp/file/filglob.cxx | 42 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontent.cxx | 104 | ||||
-rw-r--r-- | ucb/source/ucp/gio/gio_content.cxx | 165 | ||||
-rw-r--r-- | ucb/source/ucp/gio/gio_content.hxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.cxx | 67 | ||||
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.cxx | 73 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 109 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 153 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.hxx | 2 |
18 files changed, 465 insertions, 399 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 9449061a2fac..d363044f6d19 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( - IllegalArgumentException( + makeAny( 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( - IllegalArgumentException( + makeAny( IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -677,9 +677,9 @@ Any SAL_CALL UniversalContentBroker::execute( ucbhelper::cancelCommandExecution( - UnsupportedCommandException( + makeAny( 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 20fa1c5e72e3..988efa3ab0f9 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( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Unknown transfer operation!", rContext.xProcessor, - -1 ), + -1 ) ), rContext.xOrigEnv ); // Unreachable } @@ -1027,9 +1027,9 @@ void handleNameClashRename( if ( aOldTitle.isEmpty() ) { ucbhelper::cancelCommandExecution( - beans::UnknownPropertyException( + uno::makeAny( beans::UnknownPropertyException( "Unable to get property 'Title' from new object!", - rContext.xProcessor ), + rContext.xProcessor ) ), rContext.xOrigEnv ); // Unreachable } @@ -1141,10 +1141,11 @@ 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 } @@ -1162,9 +1163,9 @@ void globalTransfer_( if ( !bSourceIsFolder && xSourceProps->wasNull() ) { ucbhelper::cancelCommandExecution( - beans::UnknownPropertyException( + uno::makeAny( beans::UnknownPropertyException( "Unable to get property 'IsFolder' from source object!", - rContext.xProcessor ), + rContext.xProcessor ) ), rContext.xOrigEnv ); // Unreachable } @@ -1174,9 +1175,9 @@ void globalTransfer_( if ( !bSourceIsDocument && xSourceProps->wasNull() ) { ucbhelper::cancelCommandExecution( - beans::UnknownPropertyException( + uno::makeAny( beans::UnknownPropertyException( "Unable to get property 'IsDocument' from source object!", - rContext.xProcessor ), + rContext.xProcessor ) ), rContext.xOrigEnv ); // Unreachable } @@ -1360,11 +1361,12 @@ 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 } @@ -1455,11 +1457,12 @@ 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 fbc0e0711c9d..6818f6d94aaf 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; } - lang::IllegalArgumentException Content::getBadArgExcept() + uno::Any Content::getBadArgExcept() { - return lang::IllegalArgumentException( + return uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", - static_cast< cppu::OWeakObject * >( this ), -1); + static_cast< cppu::OWeakObject * >( this ), -1) ); } libcmis::ObjectPtr Content::updateProperties( @@ -980,12 +980,13 @@ namespace cmis { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); - - ucbhelper::cancelCommandExecution( + uno::Any aErr = uno::makeAny( ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs), - xEnv); + bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs) + ); + + ucbhelper::cancelCommandExecution(aErr, xEnv); } uno::Any aRet; @@ -1010,9 +1011,9 @@ namespace cmis ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedOpenModeException + uno::makeAny ( ucb::UnsupportedOpenModeException ( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rOpenCommand.Mode ) ), + sal_Int16( rOpenCommand.Mode ) ) ), xEnv ); } @@ -1024,9 +1025,9 @@ namespace cmis SAL_INFO( "ucb.ucp.cmis", "Failed to copy data to sink" ); ucbhelper::cancelCommandExecution( - ucb::UnsupportedDataSinkException + uno::makeAny (ucb::UnsupportedDataSinkException ( OUString(), static_cast< cppu::OWeakObject * >( this ), - rOpenCommand.Sink ), + rOpenCommand.Sink ) ), xEnv ); } } @@ -1269,9 +1270,10 @@ namespace cmis if ( sSrcBindingUrl != m_aURL.getBindingUrl( ) ) { ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( + ucb::InteractiveBadTransferURLException( "Unsupported URL scheme!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } } @@ -1285,9 +1287,9 @@ namespace cmis { if ( !xInputStream.is() ) { - ucbhelper::cancelCommandExecution( - ucb::MissingInputStreamException - ( OUString(), static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( ucb::MissingInputStreamException + ( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } @@ -1312,9 +1314,9 @@ namespace cmis map< string, libcmis::PropertyPtr >::iterator it = m_pObjectProps.find( "cmis:name" ); if ( it == m_pObjectProps.end( ) ) { - ucbhelper::cancelCommandExecution( - uno::RuntimeException( "Missing name property", - static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( uno::RuntimeException( "Missing name property", + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } string newName = it->second->getStrings( ).front( ); @@ -1340,9 +1342,9 @@ namespace cmis // Are the base type matching? if ( object->getBaseType( ) != m_pObjectType->getBaseType( )->getId() ) { - ucbhelper::cancelCommandExecution( - uno::RuntimeException( "Can't change a folder into a document and vice-versa.", - static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( uno::RuntimeException( "Can't change a folder into a document and vice-versa.", + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } @@ -1359,9 +1361,9 @@ namespace cmis } catch ( const libcmis::Exception& ) { - ucbhelper::cancelCommandExecution( - uno::RuntimeException( "Error when setting document content", - static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( uno::RuntimeException( "Error when setting document content", + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } } @@ -1381,9 +1383,9 @@ namespace cmis } catch ( const libcmis::Exception& ) { - ucbhelper::cancelCommandExecution( - uno::RuntimeException( "Error when creating folder", - static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( uno::RuntimeException( "Error when creating folder", + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } } @@ -1399,9 +1401,9 @@ namespace cmis } catch ( const libcmis::Exception& ) { - ucbhelper::cancelCommandExecution( - uno::RuntimeException( "Error when creating document", - static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( uno::RuntimeException( "Error when creating document", + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } } @@ -1883,10 +1885,10 @@ namespace cmis { SAL_INFO( "ucb.ucp.cmis", "Unknown command to execute" ); - ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException + ucbhelper::cancelCommandExecution + ( uno::makeAny( 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 357845cd9a26..366b1a488228 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::lang::IllegalArgumentException getBadArgExcept(); + css::uno::Any 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 552532b79cd2..f130b83b054c 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 { } - lang::IllegalArgumentException RepoContent::getBadArgExcept() + uno::Any RepoContent::getBadArgExcept() { - return lang::IllegalArgumentException( + return uno::makeAny( 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 2ce3b5df83a5..4be969ee1c24 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::lang::IllegalArgumentException getBadArgExcept(); + css::uno::Any 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 562d81030dcb..950a953fed99 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( IllegalArgumentException( - OUString(), *this, -1 ), + ::ucbhelper::cancelCommandExecution( makeAny( 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( IllegalArgumentException( - OUString(), *this, -1 ), + ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( + OUString(), *this, -1 ) ), i_rEvironment ); // unreachable } if ( !aProperties.getLength() ) { - ::ucbhelper::cancelCommandExecution( IllegalArgumentException( - OUString(), *this, -1 ), + ::ucbhelper::cancelCommandExecution( makeAny( 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( IllegalArgumentException( - OUString(), *this, -1 ), + ::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( + OUString(), *this, -1 ) ), i_rEvironment ); // unreachable } @@ -263,8 +263,8 @@ namespace ucb { namespace ucp { namespace ext else { - ::ucbhelper::cancelCommandExecution( UnsupportedCommandException( - OUString(), *this ), + ::ucbhelper::cancelCommandExecution( makeAny( UnsupportedCommandException( + OUString(), *this ) ), i_rEvironment ); // unreachable } diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 782407ba58ce..32010ebf050e 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -245,11 +245,13 @@ namespace fileaccess { bool isHandled ) { Reference<XCommandProcessor> xComProc(pContent); + Any aAny; IOErrorCode ioErrorCode; if( errorCode == TASKHANDLER_UNSUPPORTED_COMMAND ) { - cancelCommandExecution( UnsupportedCommandException( OSL_LOG_PREFIX ), xEnv ); + aAny <<= UnsupportedCommandException( OSL_LOG_PREFIX ); + cancelCommandExecution( aAny,xEnv ); } else if( errorCode == TASKHANDLING_WRONG_SETPROPERTYVALUES_ARGUMENT || errorCode == TASKHANDLING_WRONG_GETPROPERTYVALUES_ARGUMENT || @@ -261,13 +263,13 @@ namespace fileaccess { { IllegalArgumentException excep; excep.ArgumentPosition = 0; - cancelCommandExecution(excep, xEnv); + cancelCommandExecution(Any(excep), xEnv); } else if( errorCode == TASKHANDLING_UNSUPPORTED_OPEN_MODE ) { UnsupportedOpenModeException excep; excep.Mode = sal::static_int_cast< sal_Int16 >(minorCode); - cancelCommandExecution( excep,xEnv ); + cancelCommandExecution( Any(excep),xEnv ); } else if(errorCode == TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND || errorCode == TASKHANDLING_INSERTED_STATE_IN_OPEN_COMMAND || @@ -503,12 +505,11 @@ namespace fileaccess { OUString("Title") : OUString("ContentType"); - cancelCommandExecution( - MissingPropertiesException( - "a property is missing, necessary to create a content", - xComProc, - aSeq), - xEnv); + aAny <<= MissingPropertiesException( + "a property is missing, necessary to create a content", + xComProc, + aSeq); + cancelCommandExecution(aAny,xEnv); } else if( errorCode == TASKHANDLING_FILESIZE_FOR_WRITE ) { @@ -534,11 +535,11 @@ namespace fileaccess { } else if(errorCode == TASKHANDLING_INPUTSTREAM_FOR_WRITE) { - cancelCommandExecution( + aAny <<= MissingInputStreamException( "the inputstream is missing, necessary to create a content", - xComProc), - xEnv); + xComProc); + cancelCommandExecution(aAny,xEnv); } else if( errorCode == TASKHANDLING_NOREPLACE_FOR_WRITE ) // Overwrite = false and file exists @@ -548,7 +549,7 @@ namespace fileaccess { excep.Classification = InteractionClassification_ERROR; excep.Context = Reference<XInterface>( xComProc, UNO_QUERY ); excep.Message = "file exists and overwrite forbidden"; - cancelCommandExecution( excep, xEnv ); + cancelCommandExecution( Any(excep), xEnv ); } else if( errorCode == TASKHANDLING_INVALID_NAME_MKDIR ) { @@ -572,7 +573,7 @@ namespace fileaccess { if(isHandled) throw excep; else { - cancelCommandExecution( excep, xEnv ); + cancelCommandExecution( Any(excep), xEnv ); } // ioErrorCode = IOErrorCode_INVALID_CHARACTER; // cancelCommandExecution( @@ -592,7 +593,7 @@ namespace fileaccess { if(isHandled) throw excep; else { - cancelCommandExecution( excep, xEnv ); + cancelCommandExecution( Any(excep), xEnv ); } // ioErrorCode = IOErrorCode_ALREADY_EXISTING; // cancelCommandExecution( @@ -778,11 +779,10 @@ namespace fileaccess { } else if( errorCode == TASKHANDLING_TRANSFER_INVALIDSCHEME ) { - cancelCommandExecution( - InteractiveBadTransferURLException( + aAny <<= InteractiveBadTransferURLException( "bad transfer url", - xComProc), - xEnv ); + xComProc); + cancelCommandExecution( aAny,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(excep, xEnv); + cancelCommandExecution(Any(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(excep, xEnv); + cancelCommandExecution(Any(excep), xEnv); } else { diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 846a6127412c..6fcea525b790 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -296,6 +296,21 @@ 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: @@ -303,7 +318,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, case THROWAUTHENTICATIONREQUEST: ucbhelper::cancelCommandExecution( - aRet.get<css::uno::Exception>(), + aRet, Reference<XCommandEnvironment>(nullptr)); break; @@ -326,8 +341,9 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { InteractiveNetworkConnectException excep; excep.Server = m_aFTPURL.host(); + aRet <<= excep; ucbhelper::cancelCommandExecution( - excep, + aRet, Environment); break; } @@ -335,8 +351,9 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { InteractiveNetworkResolveNameException excep; excep.Server = m_aFTPURL.host(); + aRet <<= excep; ucbhelper::cancelCommandExecution( - excep, + aRet, Environment); break; } @@ -368,12 +385,11 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, Sequence<Property> Properties; if(!(aCommand.Argument >>= Properties)) { - ucbhelper::cancelCommandExecution( - IllegalArgumentException( + aRet <<= IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1), - Environment); + -1); + ucbhelper::cancelCommandExecution(aRet,Environment); } aRet <<= getPropertyValues(Properties,Environment); @@ -383,12 +399,11 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, Sequence<PropertyValue> propertyValues; if( ! ( aCommand.Argument >>= propertyValues ) ) { - ucbhelper::cancelCommandExecution( - IllegalArgumentException( + aRet <<= IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1), - Environment); + -1); + ucbhelper::cancelCommandExecution(aRet,Environment); } aRet <<= setPropertyValues(propertyValues); @@ -405,12 +420,11 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { - ucbhelper::cancelCommandExecution( - IllegalArgumentException( + aRet <<= IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1), - Environment); + -1); + ucbhelper::cancelCommandExecution(aRet,Environment); } insert(aInsertArgument,Environment); } @@ -421,12 +435,12 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, else if(aCommand.Name == "open") { OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { - ucbhelper::cancelCommandExecution( - IllegalArgumentException( + aRet <<= IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1), - Environment); + -1); + + ucbhelper::cancelCommandExecution(aRet,Environment); } if(aOpenCommand.Mode == OpenMode::DOCUMENT) { @@ -477,12 +491,11 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, } } else { - ucbhelper::cancelCommandExecution( - UnsupportedDataSinkException( - OUString(), - static_cast< cppu::OWeakObject * >(this), - aOpenCommand.Sink), - Environment); + aRet <<= UnsupportedDataSinkException( + OUString(), + static_cast< cppu::OWeakObject * >(this), + aOpenCommand.Sink); + ucbhelper::cancelCommandExecution(aRet,Environment); } } else if(aOpenCommand.Mode == OpenMode::ALL || @@ -505,39 +518,38 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, aOpenCommand.Mode == OpenMode::DOCUMENT_SHARE_DENY_WRITE) { // Unsupported OpenMode - ucbhelper::cancelCommandExecution( - UnsupportedOpenModeException( - OUString(), - static_cast< cppu::OWeakObject * >(this), - static_cast< sal_Int16 >(aOpenCommand.Mode)), - Environment); + aRet <<= UnsupportedOpenModeException( + OUString(), + static_cast< cppu::OWeakObject * >(this), + static_cast< sal_Int16 >(aOpenCommand.Mode)); + ucbhelper::cancelCommandExecution(aRet,Environment); } else { - ucbhelper::cancelCommandExecution( - IllegalArgumentException( + aRet <<= IllegalArgumentException( "Unexpected OpenMode!", static_cast< cppu::OWeakObject * >(this), - -1), - Environment); + -1); + + ucbhelper::cancelCommandExecution(aRet,Environment); } } else if(aCommand.Name == "createNewContent") { ContentInfo aArg; if (!(aCommand.Argument >>= aArg)) { ucbhelper::cancelCommandExecution( - IllegalArgumentException( + makeAny( + IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), - -1), + -1)), Environment); // Unreachable } aRet <<= createNewContent(aArg); } else { - ucbhelper::cancelCommandExecution( - UnsupportedCommandException( - aCommand.Name, - static_cast< cppu::OWeakObject * >(this)), - Environment); + aRet <<= UnsupportedCommandException( + aCommand.Name, + static_cast< cppu::OWeakObject * >(this)); + ucbhelper::cancelCommandExecution(aRet,Environment); } return aRet; @@ -676,7 +688,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, MissingPropertiesException excep; excep.Properties.realloc(1); excep.Properties[0] = "Title"; - ucbhelper::cancelCommandExecution(excep, Env); + ucbhelper::cancelCommandExecution(Any(excep), Env); } if(m_bInserted && @@ -684,7 +696,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, !aInsertCommand.Data.is()) { MissingInputStreamException excep; - ucbhelper::cancelCommandExecution(excep, Env); + ucbhelper::cancelCommandExecution(Any(excep), Env); } bool bReplace(aInsertCommand.ReplaceExisting); @@ -702,7 +714,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, // Deprecated, not used anymore: NameClashException excep; excep.Name = m_aFTPURL.child(); - ucbhelper::cancelCommandExecution(excep, Env); + ucbhelper::cancelCommandExecution(Any(excep), Env); } else if(e.code() == FOLDER_MIGHT_EXIST_DURING_INSERT || e.code() == FILE_MIGHT_EXIST_DURING_INSERT) { // Interact @@ -714,7 +726,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, excep.NameClash = 0; //NameClash::ERROR; if(!xInt.is()) { - ucbhelper::cancelCommandExecution(excep, Env); + ucbhelper::cancelCommandExecution(Any(excep), Env); } XInteractionRequestImpl request; diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 61d8c0aa83a0..a6467d548b76 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 { \ - aRet.reset(new aExcept); \ - if (bThrow) throw *aRet;\ + if (bThrow) throw aExcept;\ + aRet = uno::makeAny( aExcept );\ } while(false) -std::unique_ptr<uno::Exception> convertToException(GError *pError, const uno::Reference< uno::XInterface >& rContext, bool bThrow) +uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterface >& rContext, bool bThrow) { - std::unique_ptr<uno::Exception> aRet; + uno::Any aRet; gint eCode = pError->code; OUString sMessage(pError->message, strlen(pError->message), RTL_TEXTENCODING_UTF8); @@ -160,88 +160,108 @@ std::unique_ptr<uno::Exception> convertToException(GError *pError, const uno::Re switch (eCode) { case G_IO_ERROR_FAILED: - EXCEPT(io::IOException(sMessage, rContext)); + { io::IOException aExcept(sMessage, rContext); + EXCEPT(aExcept); } break; case G_IO_ERROR_NOT_MOUNTED: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING_PATH, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING_PATH, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_NOT_FOUND: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_EXISTS: - EXCEPT( ucb::NameClashException(sMessage, rContext, - task::InteractionClassification_ERROR, sName)); + { ucb::NameClashException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, sName); + EXCEPT(aExcept); } break; case G_IO_ERROR_INVALID_ARGUMENT: - EXCEPT( lang::IllegalArgumentException(sMessage, rContext, -1 ) ); + { lang::IllegalArgumentException aExcept(sMessage, rContext, -1 ); + EXCEPT(aExcept); } break; case G_IO_ERROR_PERMISSION_DENIED: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_ACCESS_DENIED, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_ACCESS_DENIED, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_IS_DIRECTORY: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_NOT_REGULAR_FILE: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_NOT_DIRECTORY: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_DIRECTORY, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_DIRECTORY, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_FILENAME_TOO_LONG: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NAME_TOO_LONG, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NAME_TOO_LONG, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_PENDING: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_PENDING, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_PENDING, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_CLOSED: case G_IO_ERROR_CANCELLED: case G_IO_ERROR_TOO_MANY_LINKS: case G_IO_ERROR_WRONG_ETAG: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_GENERAL, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_GENERAL, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_NOT_SUPPORTED: case G_IO_ERROR_CANT_CREATE_BACKUP: case G_IO_ERROR_WOULD_MERGE: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_SUPPORTED, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_SUPPORTED, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_NO_SPACE: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_OUT_OF_DISK_SPACE, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_OUT_OF_DISK_SPACE, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_INVALID_FILENAME: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_INVALID_CHARACTER, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_INVALID_CHARACTER, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_READ_ONLY: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_WRITE_PROTECTED, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_WRITE_PROTECTED, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_TIMED_OUT: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_DEVICE_NOT_READY, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_DEVICE_NOT_READY, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_WOULD_RECURSE: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_RECURSIVE, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_RECURSIVE, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_BUSY: case G_IO_ERROR_WOULD_BLOCK: - EXCEPT( ucb::InteractiveAugmentedIOException(sMessage, rContext, - task::InteractionClassification_ERROR, ucb::IOErrorCode_LOCKING_VIOLATION, aArgs)); + { ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, ucb::IOErrorCode_LOCKING_VIOLATION, aArgs); + EXCEPT(aExcept); } break; case G_IO_ERROR_HOST_NOT_FOUND: - EXCEPT( ucb::InteractiveNetworkResolveNameException(sMessage, rContext, - task::InteractionClassification_ERROR, sHost)); + { ucb::InteractiveNetworkResolveNameException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR, sHost); + EXCEPT(aExcept);} break; default: case G_IO_ERROR_ALREADY_MOUNTED: @@ -249,8 +269,9 @@ std::unique_ptr<uno::Exception> convertToException(GError *pError, const uno::Re case G_IO_ERROR_NOT_SYMBOLIC_LINK: case G_IO_ERROR_NOT_MOUNTABLE_FILE: case G_IO_ERROR_FAILED_HANDLED: - EXCEPT( ucb::InteractiveNetworkGeneralException(sMessage, rContext, - task::InteractionClassification_ERROR)); + { ucb::InteractiveNetworkGeneralException aExcept(sMessage, rContext, + task::InteractionClassification_ERROR); + EXCEPT(aExcept);} break; } return aRet; @@ -279,19 +300,19 @@ void convertToIOException(GError *pError, const uno::Reference< uno::XInterface } } -std::unique_ptr<uno::Exception> Content::mapGIOError( GError *pError ) +uno::Any Content::mapGIOError( GError *pError ) { if (!pError) - return std::unique_ptr<uno::Exception>(new lang::IllegalArgumentException(getBadArgExcept())); + return getBadArgExcept(); return convertToException(pError, static_cast< cppu::OWeakObject * >(this), false); } -lang::IllegalArgumentException Content::getBadArgExcept() +uno::Any Content::getBadArgExcept() { - return lang::IllegalArgumentException( + return uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", - static_cast< cppu::OWeakObject * >( this ), -1); + static_cast< cppu::OWeakObject * >( this ), -1) ); } class MountOperation @@ -635,7 +656,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { if (!mbTransient) - ucbhelper::cancelCommandExecution(*mapGIOError(pError), xEnv); + ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); else { if (pError) @@ -724,7 +745,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ((bOk = doSetFileInfo(pNewInfo))) { for (sal_Int32 i = 0; i < nChanged; ++i) - aRet[ i ] = uno::Any(getBadArgExcept()); + aRet[ i ] = getBadArgExcept(); } } @@ -838,11 +859,13 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); - ucbhelper::cancelCommandExecution( + uno::Any aErr = uno::makeAny( ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs), - xEnv); + bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs) + ); + + ucbhelper::cancelCommandExecution(aErr, xEnv); } uno::Any aRet; @@ -867,10 +890,10 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedOpenModeException + uno::makeAny ( ucb::UnsupportedOpenModeException ( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rOpenCommand.Mode ) ), - xEnv ); + sal_Int16( rOpenCommand.Mode ) ) ), + xEnv ); } if ( !feedSink( rOpenCommand.Sink, xEnv ) ) @@ -881,10 +904,10 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, SAL_WARN("ucb.ucp.gio", "Failed to load data from '" << m_xIdentifier->getContentIdentifier() << "'"); ucbhelper::cancelCommandExecution( - ucb::UnsupportedDataSinkException( - OUString(), static_cast< cppu::OWeakObject * >( this ), - rOpenCommand.Sink ), - xEnv ); + uno::makeAny (ucb::UnsupportedDataSinkException + ( OUString(), static_cast< cppu::OWeakObject * >( this ), + rOpenCommand.Sink ) ), + xEnv ); } } else @@ -961,7 +984,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 ); @@ -971,9 +994,9 @@ uno::Any SAL_CALL Content::execute( SAL_WARN("ucb.ucp.gio", "Unknown command " << aCommand.Name << "\n"); ucbhelper::cancelCommandExecution - ( ucb::UnsupportedCommandException + ( uno::makeAny( ucb::UnsupportedCommandException ( OUString(), - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } @@ -1011,15 +1034,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( - ucb::MissingInputStreamException - ( OUString(), static_cast< cppu::OWeakObject * >( this ) ), + ucbhelper::cancelCommandExecution( uno::makeAny + ( ucb::MissingInputStreamException + ( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } @@ -1027,12 +1050,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); @@ -1071,7 +1094,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 d76de9d1e832..366eb721f0c7 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" -std::unique_ptr<css::uno::Exception> convertToException(GError *pError, +css::uno::Any 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); - std::unique_ptr<css::uno::Exception> mapGIOError( GError *error ); - css::lang::IllegalArgumentException getBadArgExcept(); + css::uno::Any mapGIOError( GError *error ); + css::uno::Any 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 08be7646aff8..db8da992afde 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - ucb::MissingPropertiesException( + uno::makeAny( ucb::MissingPropertiesException( OUString(), static_cast< cppu::OWeakObject * >( this ), - aProps ), + aProps ) ), xEnv ); // Unreachable } @@ -1391,11 +1391,12 @@ 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 } @@ -1423,10 +1424,11 @@ 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 } @@ -1446,10 +1448,11 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, if ( hasData( xId ) ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedNameClashException( + uno::makeAny( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ), + nNameClashResolve ) ), xEnv ); // Unreachable } @@ -1503,9 +1506,9 @@ void HierarchyContent::destroy( bool bDeletePhysical, if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1514,9 +1517,9 @@ void HierarchyContent::destroy( bool bDeletePhysical, if ( m_eKind == ROOT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not supported by root folder!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1555,9 +1558,9 @@ void HierarchyContent::transfer( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1566,9 +1569,9 @@ void HierarchyContent::transfer( if ( !rInfo.SourceURL.startsWith( HIERARCHY_URL_SCHEME ":/" ) ) { ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( 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 6f179a8d17ee..2fe01f03aff3 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - ucb::UnsupportedOpenModeException( + uno::makeAny( ucb::UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rArg.Mode ) ), + sal_Int16( rArg.Mode ) ) ), xEnv ); // Unreachable } @@ -1522,10 +1522,11 @@ uno::Any Content::open( // implementation. Support for this type of // sink is optional... ucbhelper::cancelCommandExecution( - ucb::UnsupportedDataSinkException( + uno::makeAny( + ucb::UnsupportedDataSinkException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArg.Sink ), + rArg.Sink ) ), xEnv ); // Unreachable } @@ -1558,9 +1559,9 @@ void Content::insert( if ( !xStream.is() ) { ucbhelper::cancelCommandExecution( - ucb::MissingInputStreamException( + uno::makeAny( ucb::MissingInputStreamException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1585,11 +1586,11 @@ void Content::insert( if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - ucb::NameClashException( + uno::makeAny( ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_aProps.aTitle ), + m_aProps.aTitle ) ), xEnv ); // Unreachable } @@ -1617,11 +1618,12 @@ void Content::insert( if ( nTry == 1000 ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedNameClashException( + uno::makeAny( + ucb::UnsupportedNameClashException( "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ), - xEnv ); + nNameClashResolve ) ), + xEnv ); // Unreachable } else @@ -1638,10 +1640,11 @@ void Content::insert( if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedNameClashException( + uno::makeAny( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ), + nNameClashResolve ) ), xEnv ); // Unreachable } @@ -1706,9 +1709,9 @@ void Content::destroy( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1747,9 +1750,9 @@ void Content::transfer( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1760,9 +1763,9 @@ void Content::transfer( m_aUri.getUri(), PACKAGE_URL_SCHEME_LENGTH + 3 ) != 0 ) ) { ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( 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 fdf63317df44..39fec06b4f24 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - lang::IllegalArgumentException( + uno::makeAny( 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( - ucb::UnsupportedCommandException( + uno::makeAny( 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( - ucb::UnsupportedOpenModeException( + uno::makeAny( ucb::UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rArg.Mode ) ), + sal_Int16( rArg.Mode ) ) ), xEnv ); // Unreachable } @@ -1530,10 +1530,11 @@ uno::Any Content::open( else { ucbhelper::cancelCommandExecution( - ucb::UnsupportedDataSinkException( + uno::makeAny( + ucb::UnsupportedDataSinkException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArg.Sink ), + rArg.Sink ) ), xEnv ); // Unreachable } @@ -1584,9 +1585,9 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( !xData.is() ) { ucbhelper::cancelCommandExecution( - ucb::MissingInputStreamException( + uno::makeAny( ucb::MissingInputStreamException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1609,11 +1610,11 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - ucb::NameClashException( + uno::makeAny( ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_aProps.getTitle() ), + m_aProps.getTitle() ) ), xEnv ); // Unreachable } @@ -1641,10 +1642,11 @@ 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 } @@ -1664,10 +1666,11 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, if ( hasData( aNewUri ) ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedNameClashException( + uno::makeAny( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - nNameClashResolve ), + nNameClashResolve ) ), xEnv ); // Unreachable } @@ -1732,9 +1735,9 @@ void Content::destroy( bool bDeletePhysical, if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1871,9 +1874,9 @@ void Content::transfer( if ( m_eState != PERSISTENT ) { ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( "Not persistent!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1884,9 +1887,9 @@ void Content::transfer( { // Invalid length (to short). ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( ucb::InteractiveBadTransferURLException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1898,9 +1901,9 @@ void Content::transfer( { // Invalid scheme. ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( ucb::InteractiveBadTransferURLException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable } @@ -1910,10 +1913,10 @@ void Content::transfer( if ( !aSourceUri.isValid() ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Invalid source URI! Syntax!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), xEnv ); // Unreachable } @@ -1921,10 +1924,10 @@ void Content::transfer( if ( aSourceUri.isRoot() || aSourceUri.isDocument() ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Invalid source URI! Must describe a folder or stream!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), xEnv ); // Unreachable } @@ -1972,13 +1975,13 @@ void Content::transfer( if ( xStorage->isStreamElement( aSourceUri.getDecodedName() ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Invalid source URI! " "Streams cannot be created as " "children of document root!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), xEnv ); // Unreachable } @@ -2001,10 +2004,10 @@ void Content::transfer( if ( !bOK ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( 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 b82ddde4e7ce..c825798aaa76 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -39,7 +39,6 @@ #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> @@ -508,10 +507,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= Properties ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -528,10 +527,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aProperties ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -539,10 +538,10 @@ uno::Any SAL_CALL Content::execute( if ( !aProperties.getLength() ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "No properties!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -579,10 +578,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aTmp ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -609,10 +608,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= arg ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -673,10 +672,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= transferArgs ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -693,10 +692,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aArg ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -742,10 +741,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aArg ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); // Unreachable } @@ -758,10 +757,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= aPropArg )) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); } @@ -773,15 +772,15 @@ uno::Any SAL_CALL Content::execute( } catch ( const beans::PropertyExistException &e ) { - ucbhelper::cancelCommandExecution( e, Environment ); + ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment ); } catch ( const beans::IllegalTypeException&e ) { - ucbhelper::cancelCommandExecution( e, Environment ); + ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment ); } catch ( const lang::IllegalArgumentException&e ) { - ucbhelper::cancelCommandExecution( e, Environment ); + ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment ); } } else if ( aCommand.Name == "removeProperty" ) @@ -790,10 +789,10 @@ uno::Any SAL_CALL Content::execute( if ( !( aCommand.Argument >>= sPropName ) ) { ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( lang::IllegalArgumentException( "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), Environment ); } @@ -805,11 +804,11 @@ uno::Any SAL_CALL Content::execute( } catch( const beans::UnknownPropertyException &e ) { - ucbhelper::cancelCommandExecution( e, Environment ); + ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment ); } catch( const beans::NotRemoveableException &e ) { - ucbhelper::cancelCommandExecution( e, Environment ); + ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment ); } } else @@ -819,9 +818,9 @@ uno::Any SAL_CALL Content::execute( ucbhelper::cancelCommandExecution( - ucb::UnsupportedCommandException( + uno::makeAny( ucb::UnsupportedCommandException( aCommand.Name, - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable } @@ -2133,8 +2132,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( aNewTitle.clear(); // Set error . - auto ex = MapDAVException( e, true ); - aRet[ nTitlePos ] = makeAny(*ex); + aRet[ nTitlePos ] = MapDAVException( e, true ); } } @@ -2203,10 +2201,11 @@ uno::Any Content::open( } ucbhelper::cancelCommandExecution( - lang::IllegalArgumentException( + uno::makeAny( + lang::IllegalArgumentException( aMsg.makeStringAndClear(), static_cast< cppu::OWeakObject * >( this ), - -1 ), + -1 ) ), xEnv ); // Unreachable } @@ -2221,10 +2220,11 @@ uno::Any Content::open( { // Currently(?) unsupported. ucbhelper::cancelCommandExecution( - ucb::UnsupportedOpenModeException( + uno::makeAny( + ucb::UnsupportedOpenModeException( OUString(), static_cast< cppu::OWeakObject * >( this ), - sal_Int16( rArg.Mode ) ), + sal_Int16( rArg.Mode ) ) ), xEnv ); // Unreachable } @@ -2346,10 +2346,11 @@ uno::Any Content::open( // implementation. Support for this type of // sink is optional... ucbhelper::cancelCommandExecution( - ucb::UnsupportedDataSinkException( + uno::makeAny( + ucb::UnsupportedDataSinkException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArg.Sink ), + rArg.Sink ) ), xEnv ); // Unreachable } @@ -2432,10 +2433,11 @@ void Content::post( else { ucbhelper::cancelCommandExecution( - ucb::UnsupportedDataSinkException( + uno::makeAny( + ucb::UnsupportedDataSinkException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArg.Sink ), + rArg.Sink ) ), xEnv ); // Unreachable } @@ -2520,10 +2522,10 @@ void Content::insert( uno::Sequence<OUString> aProps { "Title" }; ucbhelper::cancelCommandExecution( - ucb::MissingPropertiesException( + uno::makeAny( ucb::MissingPropertiesException( OUString(), static_cast< cppu::OWeakObject * >( this ), - aProps ), + aProps ) ), Environment ); // Unreachable } @@ -2692,11 +2694,12 @@ void Content::insert( } ucbhelper::cancelCommandExecution( - ucb::NameClashException( + uno::makeAny( + ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - aTitle ), + aTitle ) ), Environment ); // Unreachable } @@ -2724,9 +2727,10 @@ void Content::insert( if ( !xInputStream.is() ) { ucbhelper::cancelCommandExecution( - ucb::MissingInputStreamException( + uno::makeAny( + ucb::MissingInputStreamException( OUString(), - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable } @@ -2807,9 +2811,10 @@ void Content::transfer( if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME ) { ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( + ucb::InteractiveBadTransferURLException( "Unsupported URL scheme!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable } @@ -2839,9 +2844,9 @@ void Content::transfer( ( sourceURI.GetHost() != targetURI.GetHost() ) ) { ucbhelper::cancelCommandExecution( - ucb::InteractiveBadTransferURLException( + uno::makeAny( ucb::InteractiveBadTransferURLException( "Different hosts!", - static_cast< cppu::OWeakObject * >( this ) ), + static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable } @@ -2963,11 +2968,12 @@ void Content::transfer( case ucb::NameClash::ERROR: { ucbhelper::cancelCommandExecution( - ucb::NameClashException( + uno::makeAny( + ucb::NameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - aTargetURI ), + aTargetURI ) ), Environment ); SAL_FALLTHROUGH; // Unreachable } @@ -2981,10 +2987,11 @@ void Content::transfer( default: { ucbhelper::cancelCommandExecution( - ucb::UnsupportedNameClashException( + uno::makeAny( + ucb::UnsupportedNameClashException( OUString(), static_cast< cppu::OWeakObject * >( this ), - rArgs.NameClash ), + rArgs.NameClash ) ), Environment ); // Unreachable } @@ -3542,10 +3549,10 @@ bool Content::isFolder( } -std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e, bool bWrite ) +uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) { // Map DAVException... - std::unique_ptr<uno::Exception> aException; + uno::Any aException; OUString aURL; if ( m_bTransient ) @@ -3571,13 +3578,14 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e uno::makeAny(aURL), beans::PropertyState_DIRECT_VALUE); - return - o3tl::make_unique<ucb::InteractiveAugmentedIOException>( + aException <<= + ucb::InteractiveAugmentedIOException( "Not found!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, aArgs ); + return aException; } default: break; @@ -3588,13 +3596,15 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e case DAVException::DAV_HTTP_ERROR: { if ( bWrite ) - return o3tl::make_unique<ucb::InteractiveNetworkWriteException>( + aException <<= + ucb::InteractiveNetworkWriteException( e.getData(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, e.getData() ); else - o3tl::make_unique<ucb::InteractiveNetworkReadException>( + aException <<= + ucb::InteractiveNetworkReadException( e.getData(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3603,7 +3613,8 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e } case DAVException::DAV_HTTP_LOOKUP: - o3tl::make_unique<ucb::InteractiveNetworkResolveNameException>( + aException <<= + ucb::InteractiveNetworkResolveNameException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3620,7 +3631,8 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e case DAVException::DAV_HTTP_TIMEOUT: case DAVException::DAV_HTTP_CONNECT: - o3tl::make_unique<ucb::InteractiveNetworkConnectException>( + aException <<= + ucb::InteractiveNetworkConnectException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3636,14 +3648,16 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e // break; case DAVException::DAV_INVALID_ARG: - o3tl::make_unique<lang::IllegalArgumentException>( + aException <<= + lang::IllegalArgumentException( OUString(), static_cast< cppu::OWeakObject * >( this ), -1 ); break; case DAVException::DAV_LOCKED: - o3tl::make_unique<ucb::InteractiveLockingLockedException>( + aException <<= + ucb::InteractiveLockingLockedException( "Locked!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3652,7 +3666,8 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e break; case DAVException::DAV_LOCKED_SELF: - o3tl::make_unique<ucb::InteractiveLockingLockedException>( + aException <<= + ucb::InteractiveLockingLockedException( "Locked (self!)", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3661,7 +3676,8 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e break; case DAVException::DAV_NOT_LOCKED: - o3tl::make_unique<ucb::InteractiveLockingNotLockedException>( + aException <<= + ucb::InteractiveLockingNotLockedException( "Not locked!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3669,7 +3685,8 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e break; case DAVException::DAV_LOCK_EXPIRED: - o3tl::make_unique<ucb::InteractiveLockingLockExpiredException>( + aException <<= + ucb::InteractiveLockingLockExpiredException( "Lock expired!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, @@ -3677,7 +3694,8 @@ std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e break; default: - o3tl::make_unique<ucb::InteractiveNetworkGeneralException>( + aException <<= + ucb::InteractiveNetworkGeneralException( OUString(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR ); @@ -3709,8 +3727,7 @@ void Content::cancelCommandExecution( const uno::Reference< ucb::XCommandEnvironment > & xEnv, bool bWrite /* = sal_False */ ) { - auto ex = MapDAVException( e, bWrite ); - ucbhelper::cancelCommandExecution( *ex, xEnv ); + ucbhelper::cancelCommandExecution( MapDAVException( e, bWrite ), xEnv ); // Unreachable } diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx b/ucb/source/ucp/webdav-neon/webdavcontent.hxx index 8ee6083a2bc1..571dec7b2fa6 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx @@ -189,7 +189,7 @@ private: /// @throws css::uno::Exception void unlock( const css::uno::Reference< css::ucb::XCommandEnvironment >& Environment ); - std::unique_ptr<css::uno::Exception> MapDAVException( const DAVException & e, + css::uno::Any MapDAVException( const DAVException & e, bool bWrite ); /// @throws css::uno::Exception void cancelCommandExecution( diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index a6304fef672d..5b193ea25bb4 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -3025,10 +3025,10 @@ bool Content::isFolder( } -std::unique_ptr<uno::Exception> Content::MapDAVException( const DAVException & e, bool bWrite ) +uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) { // Map DAVException... - std::unique_ptr<uno::Exception> aException; + uno::Any aException; OUString aURL; if ( m_bTransient ) diff --git a/ucb/source/ucp/webdav/webdavcontent.hxx b/ucb/source/ucp/webdav/webdavcontent.hxx index 1176a16e71ba..8eefba6f2f32 100644 --- a/ucb/source/ucp/webdav/webdavcontent.hxx +++ b/ucb/source/ucp/webdav/webdavcontent.hxx @@ -158,7 +158,7 @@ private: /// @throws css::uno::Exception void unlock( const css::uno::Reference< css::ucb::XCommandEnvironment >& Environment ); - std::unique_ptr<css::uno::Exception> MapDAVException( const DAVException & e, + css::uno::Any MapDAVException( const DAVException & e, bool bWrite ); /// @throws css::uno::Exception void cancelCommandExecution( |