From 5451e9c702afb7c570662c740b33f2481abb7cb1 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 26 Dec 2011 03:38:13 +0900 Subject: catch exception by constant reference --- sot/source/sdstor/ucbstorage.cxx | 10 +++++----- sot/source/unoolestorage/xolesimplestorage.cxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sot') diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 6fdf5fb84e26..bc2f10004955 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -881,7 +881,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary() } while( aReaded == 32000 ); } #if OSL_DEBUG_LEVEL > 1 - catch( Exception & e ) + catch( const Exception & e ) { OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else @@ -924,7 +924,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength ) m_bSourceRead = sal_False; } #if OSL_DEBUG_LEVEL > 1 - catch( Exception & e ) + catch( const Exception & e ) { OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else @@ -982,7 +982,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) memcpy( pData, aData.getArray(), aReaded ); } #if OSL_DEBUG_LEVEL > 1 - catch( Exception & e ) + catch( const Exception & e ) { OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else @@ -1990,7 +1990,7 @@ void UCBStorage_Impl::ReadContent() } } } - catch ( InteractiveIOException& r ) + catch ( const InteractiveIOException& r ) { if ( r.Code != IOErrorCode_NOT_EXISTING ) SetError( ERRCODE_IO_GENERAL ); @@ -2456,7 +2456,7 @@ sal_Int16 UCBStorage_Impl::Commit() SetError( ERRCODE_IO_GENERAL ); return COMMIT_RESULT_FAILURE; } - catch ( InteractiveIOException& r ) + catch ( const InteractiveIOException& r ) { if ( r.Code == IOErrorCode_ACCESS_DENIED || r.Code == IOErrorCode_LOCKING_VIOLATION ) SetError( ERRCODE_IO_ACCESSDENIED ); diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index bd3fd206df95..ce4c6a7931ad 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -365,7 +365,7 @@ void SAL_CALL OLESimpleStorage::insertByName( const ::rtl::OUString& aName, cons { throw; } - catch( uno::Exception& e ) + catch( const uno::Exception& e ) { throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Insert has failed!" ) ), uno::Reference< uno::XInterface >(), -- cgit