From e4ce7225dd987f9b2f250f055d9688de79931444 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 7 Jan 2012 15:50:41 +0900 Subject: catch exception by constant reference --- ucb/source/ucp/expand/ucpexpand.cxx | 2 +- ucb/source/ucp/webdav/DAVResourceAccess.cxx | 40 ++++++++++++++--------------- ucb/source/ucp/webdav/DAVResourceAccess.hxx | 2 +- ucb/workben/ucb/ucbdemo.cxx | 4 +-- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx index a3ae5710541d..0c74ba4f27b1 100644 --- a/ucb/source/ucp/expand/ucpexpand.cxx +++ b/ucb/source/ucp/expand/ucpexpand.cxx @@ -239,7 +239,7 @@ sal_Int32 ExpandContentProviderImpl::compareContentIds( OUString uri2( expandUri( xId2 ) ); return uri1.compareTo( uri2 ); } - catch (ucb::IllegalIdentifierException & exc) + catch (const ucb::IllegalIdentifierException & exc) { (void) exc; // unused OSL_FAIL( diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index cfa3c8da6e86..fb67fd379735 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -202,7 +202,7 @@ void DAVResourceAccess::OPTIONS( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -248,7 +248,7 @@ void DAVResourceAccess::PROPFIND( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -290,7 +290,7 @@ void DAVResourceAccess::PROPFIND( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ) ; } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -330,7 +330,7 @@ void DAVResourceAccess::PROPPATCH( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -371,7 +371,7 @@ void DAVResourceAccess::HEAD( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -410,7 +410,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -451,7 +451,7 @@ void DAVResourceAccess::GET( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -494,7 +494,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -539,7 +539,7 @@ void DAVResourceAccess::GET( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -624,7 +624,7 @@ void DAVResourceAccess::PUT( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -679,7 +679,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -742,7 +742,7 @@ void DAVResourceAccess::POST( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -786,7 +786,7 @@ void DAVResourceAccess::MKCOL( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -828,7 +828,7 @@ void DAVResourceAccess::COPY( aHeaders, xEnv ), bOverwrite ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -870,7 +870,7 @@ void DAVResourceAccess::MOVE( aHeaders, xEnv ), bOverwrite ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -908,7 +908,7 @@ void DAVResourceAccess::DESTROY( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -948,7 +948,7 @@ void DAVResourceAccess::LOCK( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -991,7 +991,7 @@ sal_Int64 DAVResourceAccess::LOCK( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -1031,7 +1031,7 @@ void DAVResourceAccess::UNLOCK( new DAVAuthListener_Impl( xEnv, m_aURL ), aHeaders, xEnv ) ); } - catch ( DAVException & e ) + catch ( const DAVException & e ) { errorCount++; bRetry = handleException( e, errorCount ); @@ -1182,7 +1182,7 @@ void DAVResourceAccess::resetUri() } //========================================================================= -sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) +sal_Bool DAVResourceAccess::handleException( const DAVException & e, int errorCount ) throw ( DAVException ) { switch ( e.getError() ) diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 6b2692ad349e..bb5df6161d82 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx @@ -241,7 +241,7 @@ private: const rtl::OUString & getRequestURI() const; sal_Bool detectRedirectCycle( const rtl::OUString& rRedirectURL ) throw ( DAVException ); - sal_Bool handleException( DAVException & e, int errorCount ) + sal_Bool handleException( const DAVException & e, int errorCount ) throw ( DAVException ); void initialize() throw ( DAVException ); diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx index 420e2c55acab..7ebc94a821ba 100644 --- a/ucb/workben/ucb/ucbdemo.cxx +++ b/ucb/workben/ucb/ucbdemo.cxx @@ -1174,7 +1174,7 @@ void UcbContent::open( const rtl::OUString & rName, const UniString& rInput, nLevel + 1 ) ); } } - catch ( ucb::ResultSetException ) + catch (const ucb::ResultSetException &) { print( "ResultSetException caught!" ); } @@ -2503,7 +2503,7 @@ void MyApp::Main() return; } } - catch ( uno::Exception ) + catch (const uno::Exception &) { OSL_FAIL( "Exception during creation of initial component context!" ); return; -- cgit