diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-08 03:34:57 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-08 03:35:43 +0900 |
commit | ff580eb39b46646309feba447f6bf485124db6b1 (patch) | |
tree | 5dbea85aed84589c0c1bd9859f487b9af0df7558 /unotools | |
parent | 5b031b4ea68df5ca210a5631c801414b476d8094 (diff) |
catch exception by constant reference
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/confignode.cxx | 3 | ||||
-rw-r--r-- | unotools/source/config/itemholder1.cxx | 2 | ||||
-rw-r--r-- | unotools/source/i18n/collatorwrapper.cxx | 12 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 4 | ||||
-rw-r--r-- | unotools/source/i18n/nativenumberwrapper.cxx | 12 | ||||
-rw-r--r-- | unotools/source/i18n/numberformatcodewrapper.cxx | 12 | ||||
-rw-r--r-- | unotools/source/i18n/transliterationwrapper.cxx | 6 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 2 |
8 files changed, 20 insertions, 33 deletions
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index 3aebe4d16b03..a6a413837e97 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -324,9 +324,8 @@ namespace utl if (xNode.is()) return OConfigurationNode( xNode ); } - catch(NoSuchElementException& e) + catch(const NoSuchElementException&) { - (void)e; #if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aBuf( 256 ); aBuf.append("OConfigurationNode::openNode: there is no element named "); diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx index d21684ff0484..c20128bf4773 100644 --- a/unotools/source/config/itemholder1.cxx +++ b/unotools/source/config/itemholder1.cxx @@ -89,7 +89,7 @@ ItemHolder1::ItemHolder1() xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this)); } #ifdef DBG_UTIL - catch(css::uno::Exception& rEx) + catch(const css::uno::Exception& rEx) { static sal_Bool bMessage = sal_True; if(bMessage) diff --git a/unotools/source/i18n/collatorwrapper.cxx b/unotools/source/i18n/collatorwrapper.cxx index 1c9b988315ed..6c59d438152c 100644 --- a/unotools/source/i18n/collatorwrapper.cxx +++ b/unotools/source/i18n/collatorwrapper.cxx @@ -55,9 +55,8 @@ CollatorWrapper::compareString (const ::rtl::OUString& s1, const ::rtl::OUString if (mxInternationalCollator.is()) return mxInternationalCollator->compareString (s1, s2); } - catch (uno::RuntimeException& rRuntimeException) + catch (const uno::RuntimeException&) { - (void)rRuntimeException; DBG_ERRORFILE ("CollatorWrapper: compareString failed"); } @@ -72,9 +71,8 @@ CollatorWrapper::listCollatorAlgorithms (const lang::Locale& rLocale) const if (mxInternationalCollator.is()) return mxInternationalCollator->listCollatorAlgorithms (rLocale); } - catch (uno::RuntimeException& rRuntimeException) + catch (const uno::RuntimeException&) { - (void)rRuntimeException; DBG_ERRORFILE ("CollatorWrapper: listCollatorAlgorithms failed"); } @@ -89,9 +87,8 @@ CollatorWrapper::loadDefaultCollator (const lang::Locale& rLocale, sal_Int32 nOp if (mxInternationalCollator.is()) return mxInternationalCollator->loadDefaultCollator (rLocale, nOptions); } - catch (uno::RuntimeException& rRuntimeException) + catch (const uno::RuntimeException&) { - (void)rRuntimeException; DBG_ERRORFILE ("CollatorWrapper: loadDefaultCollator failed"); } @@ -108,9 +105,8 @@ CollatorWrapper::loadCollatorAlgorithm (const ::rtl::OUString& rAlgorithm, return mxInternationalCollator->loadCollatorAlgorithm ( rAlgorithm, rLocale, nOptions); } - catch (uno::RuntimeException& rRuntimeException) + catch (const uno::RuntimeException&) { - (void)rRuntimeException; DBG_ERRORFILE ("CollatorWrapper: loadCollatorAlgorithm failed"); } diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 56944d2bb2a9..f6248e97cda1 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -292,7 +292,7 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getReservedWord( getLocale() ); } - catch ( Exception& e ) + catch ( const Exception& e ) { #ifdef DBG_UTIL rtl::OStringBuffer aMsg("getReservedWord: Exception caught\n"); @@ -318,7 +318,7 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) rInstalledLocales = xLD->getAllInstalledLocaleNames(); } - catch ( Exception& e ) + catch ( const Exception& e ) { #ifdef DBG_UTIL rtl::OStringBuffer aMsg("getAllInstalledLocaleNames: Exception caught\n"); diff --git a/unotools/source/i18n/nativenumberwrapper.cxx b/unotools/source/i18n/nativenumberwrapper.cxx index 902eebb752d8..9f831fd4e5de 100644 --- a/unotools/source/i18n/nativenumberwrapper.cxx +++ b/unotools/source/i18n/nativenumberwrapper.cxx @@ -62,9 +62,8 @@ NativeNumberWrapper::getNativeNumberString( if ( xNNS.is() ) return xNNS->getNativeNumberString( rNumberString, rLocale, nNativeNumberMode ); } - catch ( uno::Exception& e ) + catch ( const uno::Exception& ) { - (void)e; DBG_ERRORFILE( "getNativeNumberString: Exception caught!" ); } return ::rtl::OUString(); @@ -81,9 +80,8 @@ NativeNumberWrapper::isValidNatNum( if ( xNNS.is() ) return xNNS->isValidNatNum( rLocale, nNativeNumberMode ); } - catch ( uno::Exception& e ) + catch ( const uno::Exception& ) { - (void)e; DBG_ERRORFILE( "isValidNatNum: Exception caught!" ); } return sal_False; @@ -100,9 +98,8 @@ NativeNumberWrapper::convertToXmlAttributes( if ( xNNS.is() ) return xNNS->convertToXmlAttributes( rLocale, nNativeNumberMode ); } - catch ( uno::Exception& e ) + catch ( const uno::Exception& ) { - (void)e; DBG_ERRORFILE( "convertToXmlAttributes: Exception caught!" ); } return i18n::NativeNumberXmlAttributes(); @@ -118,9 +115,8 @@ NativeNumberWrapper::convertFromXmlAttributes( if ( xNNS.is() ) return xNNS->convertFromXmlAttributes( rAttr ); } - catch ( uno::Exception& e ) + catch ( const uno::Exception& ) { - (void)e; DBG_ERRORFILE( "convertFromXmlAttributes: Exception caught!" ); } return 0; diff --git a/unotools/source/i18n/numberformatcodewrapper.cxx b/unotools/source/i18n/numberformatcodewrapper.cxx index 265007213d4d..418337e301f1 100644 --- a/unotools/source/i18n/numberformatcodewrapper.cxx +++ b/unotools/source/i18n/numberformatcodewrapper.cxx @@ -70,9 +70,8 @@ NumberFormatCodeWrapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage if ( xNFC.is() ) return xNFC->getDefault( formatType, formatUsage, aLocale ); } - catch ( Exception& e ) + catch ( const Exception& e ) { - (void)e; DBG_ERRORFILE( "getDefault: Exception caught!" ); } return ::com::sun::star::i18n::NumberFormatCode(); @@ -87,9 +86,8 @@ NumberFormatCodeWrapper::getFormatCode( sal_Int16 formatIndex ) const if ( xNFC.is() ) return xNFC->getFormatCode( formatIndex, aLocale ); } - catch ( Exception& e ) + catch ( const Exception& e ) { - (void)e; DBG_ERRORFILE( "getFormatCode: Exception caught!" ); } return ::com::sun::star::i18n::NumberFormatCode(); @@ -104,9 +102,8 @@ NumberFormatCodeWrapper::getAllFormatCode( sal_Int16 formatUsage ) const if ( xNFC.is() ) return xNFC->getAllFormatCode( formatUsage, aLocale ); } - catch ( Exception& e ) + catch ( const Exception& e ) { - (void)e; DBG_ERRORFILE( "getAllFormatCode: Exception caught!" ); } return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > (0); @@ -121,9 +118,8 @@ NumberFormatCodeWrapper::getAllFormatCodes() const if ( xNFC.is() ) return xNFC->getAllFormatCodes( aLocale ); } - catch ( Exception& e ) + catch ( const Exception& e ) { - (void)e; DBG_ERRORFILE( "getAllFormatCodes: Exception caught!" ); } return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > (0); diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index 1ae8b7957265..06030ce26616 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -169,7 +169,7 @@ void TransliterationWrapper::loadModuleImpl() const if ( xTrans.is() ) xTrans->loadModule( (TransliterationModules)nType, aLocale ); } - catch ( Exception& e ) + catch ( const Exception& e ) { #ifdef DBG_UTIL rtl::OStringBuffer aMsg("loadModuleImpl: Exception caught\n"); @@ -196,7 +196,7 @@ void TransliterationWrapper::loadModuleByImplName( if ( xTrans.is() ) xTrans->loadModuleByImplName( rModuleName, aLocale ); } - catch ( Exception& e ) + catch ( const Exception& e ) { #ifdef DBG_UTIL rtl::OStringBuffer aMsg("loadModuleByImplName: Exception caught\n"); @@ -222,7 +222,7 @@ sal_Bool TransliterationWrapper::equals( if ( xTrans.is() ) return xTrans->equals( rStr1, nPos1, nCount1, nMatch1, rStr2, nPos2, nCount2, nMatch2 ); } - catch ( Exception& e ) + catch ( const Exception& e ) { #ifdef DBG_UTIL rtl::OStringBuffer aMsg("equals: Exception caught\n"); diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index e9fa41b353bf..a313a1fac18a 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -860,7 +860,7 @@ void SAL_CALL Moderator::run() nIOErrorCode = r.Code; aResultType = INTERACTIVEIO; } - catch (const UnsupportedDataSinkException ) + catch (const UnsupportedDataSinkException &) { aResultType = UNSUPPORTED; } |