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/source/ucp/tdoc | |
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/source/ucp/tdoc')
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 109 |
1 files changed, 56 insertions, 53 deletions
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 } |