diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-01-29 11:57:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 12:17:56 +0000 |
commit | 4739b31dafc5154a2c7d6b3f0ee90686863656f0 (patch) | |
tree | 0437d82f929131f3c900b5feb74cee4b1595499b /ucb/source/ucp/cmis | |
parent | 385c207e3a0b2d946ff29a9003b36f81a8946c55 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/cmis')
-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 |
4 files changed, 39 insertions, 41 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 6818f6d94aaf..fbc0e0711c9d 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 366b1a488228..357845cd9a26 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 f130b83b054c..552532b79cd2 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 4be969ee1c24..2ce3b5df83a5 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( |