diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-21 21:57:16 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-21 21:57:54 +0900 |
commit | 7958f8244cc3e554b1339b14c7e589dfcbb0526c (patch) | |
tree | 8654a25c98b3338cc9f8c4377c89d4dce06387ad /package | |
parent | 7167559379cd44e0160ba20c69cbb6954887e32b (diff) |
catch exception by constant reference
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/ohierarchyholder.cxx | 2 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 18 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx index cc36e4608330..9ab6b157a603 100644 --- a/package/source/xstor/ohierarchyholder.cxx +++ b/package/source/xstor/ohierarchyholder.cxx @@ -335,7 +335,7 @@ void SAL_CALL OHierarchyElement_Impl::commited( const ::com::sun::star::lang::Ev { Commit(); } - catch( uno::Exception& e ) + catch( const uno::Exception& e ) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not commit storage sequence!" ) ), diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 7ba64a5a466d..f5a3fdbd6cb9 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -4843,13 +4843,13 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam try { m_pImpl->ReadContents(); } - catch ( uno::RuntimeException& aRuntimeException ) + catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); throw; } - catch ( uno::Exception& aException ) + catch ( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); @@ -4867,20 +4867,20 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam xPackPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_ALGORITHMS_PROPERTY ) ), uno::makeAny( aAlgorithms ) ); } - catch ( uno::RuntimeException& aRuntimeException ) + catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); throw; } - catch( lang::IllegalArgumentException& aIAException ) + catch( const lang::IllegalArgumentException& aIAException ) { m_pImpl->AddLog( aIAException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); throw; } - catch( uno::Exception& aException ) + catch( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); @@ -4914,13 +4914,13 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() try { m_pImpl->ReadContents(); } - catch ( uno::RuntimeException& aRuntimeException ) + catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); throw; } - catch ( uno::Exception& aException ) + catch ( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); @@ -4937,13 +4937,13 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() { xPackPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_ALGORITHMS_PROPERTY ) ) ) >>= aResult; } - catch ( uno::RuntimeException& aRuntimeException ) + catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); throw; } - catch( uno::Exception& aException ) + catch( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 78980280372e..c07e7a142992 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1025,7 +1025,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) aZipOut.write( aType, 0, nBufferLength ); aZipOut.closeEntry(); } - catch ( ::com::sun::star::io::IOException & r ) + catch ( const ::com::sun::star::io::IOException & r ) { throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ), @@ -1419,7 +1419,7 @@ void SAL_CALL ZipPackage::commitChanges() { xTempSeek->seek( 0 ); } - catch( uno::Exception& r ) + catch( const uno::Exception& r ) { throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Temporary file should be seekable!" ) ), static_cast < OWeakObject * > ( this ), makeAny ( r ) ); @@ -1444,7 +1444,7 @@ void SAL_CALL ZipPackage::commitChanges() // after successful truncation the original file contents are already lost xTruncate->truncate(); } - catch( uno::Exception& r ) + catch( const uno::Exception& r ) { throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is read only!" ) ), static_cast < OWeakObject * > ( this ), makeAny ( r ) ); @@ -1543,7 +1543,7 @@ void SAL_CALL ZipPackage::commitChanges() // if the file is still not corrupted, it can become after the next step aContent.executeCommand ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "transfer" ) ), aAny ); } - catch ( ::com::sun::star::uno::Exception& r ) + catch ( const ::com::sun::star::uno::Exception& r ) { if ( bCanBeCorrupted ) DisconnectFromTargetAndThrowException_Impl( xTempInStream ); |