From 5493951893ea90b330d5280bc171a60ff46fa396 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 6 Jan 2012 00:03:58 +0900 Subject: catch exception by constant reference --- svx/source/accessibility/AccessibleShape.cxx | 6 +++--- svx/source/accessibility/DescriptionGenerator.cxx | 10 +++++----- svx/source/fmcomp/gridctrl.cxx | 3 +-- svx/source/svdraw/svdoashp.cxx | 2 +- svx/source/svdraw/svdoole2.cxx | 24 ++++++++--------------- svx/source/table/tablecontroller.cxx | 15 +++++--------- svx/source/unodraw/unopage.cxx | 2 +- svx/source/unodraw/unoshcol.cxx | 2 +- svx/workben/msview/xmlconfig.cxx | 4 +--- 9 files changed, 26 insertions(+), 42 deletions(-) (limited to 'svx') diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 7761d0faa0e4..4523f474103c 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -661,7 +661,7 @@ sal_Int32 SAL_CALL AccessibleShape::getForeground (void) aColor >>= nColor; } } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { // Ignore exception and return default color. } @@ -687,7 +687,7 @@ sal_Int32 SAL_CALL AccessibleShape::getBackground (void) aColor >>= nColor; } } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { // Ignore exception and return default color. } @@ -1008,7 +1008,7 @@ void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType, nIndex += 1; } } - catch (beans::UnknownPropertyException) + catch (const beans::UnknownPropertyException &) { // We throw our own exception that is a bit more informative. throw uno::RuntimeException (::rtl::OUString ( diff --git a/svx/source/accessibility/DescriptionGenerator.cxx b/svx/source/accessibility/DescriptionGenerator.cxx index 76ce38076b87..2c967f8c313d 100644 --- a/svx/source/accessibility/DescriptionGenerator.cxx +++ b/svx/source/accessibility/DescriptionGenerator.cxx @@ -130,7 +130,7 @@ void DescriptionGenerator::Initialize (::rtl::OUString sPrefix) msDescription.append ( OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { msDescription.append ( OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); @@ -291,7 +291,7 @@ void DescriptionGenerator::AddColor (const OUString& sPropertyName, msDescription.append (lookUpColorName(nValue)); } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { msDescription.append ( OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); @@ -317,7 +317,7 @@ void DescriptionGenerator::AddInteger (const OUString& sPropertyName, msDescription.append (nValue); } } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { msDescription.append ( OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); @@ -353,7 +353,7 @@ void DescriptionGenerator::AddString (const OUString& sPropertyName, msDescription.append (sValue); } } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { msDescription.append ( OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); @@ -440,7 +440,7 @@ void DescriptionGenerator::AddFillStyle (const OUString& sPropertyName, } } } - catch (::com::sun::star::beans::UnknownPropertyException) + catch (const ::com::sun::star::beans::UnknownPropertyException &) { msDescription.append ( OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index b03f921e415b..646bf9bba795 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -3323,9 +3323,8 @@ sal_Bool DbGridControl::SaveRow() xUpdateCursor->updateRow(); bSuccess = sal_True; } - catch(SQLException& e) + catch(SQLException&) { - (void)e; // make compiler happy EndCursorAction(); m_bUpdating = sal_False; return sal_False; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 33a0c4708c2c..5599ab3564e5 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -578,7 +578,7 @@ basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomSh aRetval = basegfx::tools::adaptiveSubdivideByAngle(aRetval); } } - catch ( const com::sun::star::lang::IllegalArgumentException ) + catch ( const com::sun::star::lang::IllegalArgumentException & ) { } } diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index db0322d0717e..904d590607f4 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -919,9 +919,8 @@ sal_Bool SdrOle2Obj::UpdateLinkURL_Impl() if ( nCurState != embed::EmbedStates::LOADED ) xObjRef->changeState( nCurState ); } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::UpdateLinkURL_Impl(), " "exception caught: ") + @@ -962,9 +961,8 @@ void SdrOle2Obj::BreakFileLink_Impl() DisconnectFileLink_Impl(); mpImpl->maLinkURL = String(); } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::BreakFileLink_Impl(), " "exception caught: ") + @@ -1014,9 +1012,8 @@ void SdrOle2Obj::CheckFileLink_Impl() } } } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::CheckFileLink_Impl(), " "exception caught: ") + @@ -1099,9 +1096,8 @@ void SdrOle2Obj::Connect_Impl() } } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::Connect_Impl(), " "exception caught: ") + @@ -1187,9 +1183,8 @@ void SdrOle2Obj::RemoveListeners_Impl() } } } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::RemoveListeners_Impl(), " "exception caught: ") + @@ -1270,9 +1265,8 @@ void SdrOle2Obj::Disconnect_Impl() GetSdrGlobalData().GetOLEObjCache().RemoveObj(this); } } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::Disconnect_Impl(), " "exception caught: ") + @@ -1328,9 +1322,8 @@ void SdrOle2Obj::SetModel(SdrModel* pNewModel) } DBG_ASSERT( aTmp.getLength(), "Copying embedded object failed!" ); } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::SetModel(), " "exception caught: ") + @@ -1886,9 +1879,8 @@ sal_Bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xOb xObj->changeState( embed::EmbedStates::LOADED ); bResult = sal_True; } - catch( ::com::sun::star::uno::Exception& e ) + catch( ::com::sun::star::uno::Exception& ) { - (void)e; OSL_FAIL( (OString("SdrOle2Obj::Unload=(), " "exception caught: ") + diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index a7e32f89d85a..6b17f79a6ded 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -609,9 +609,8 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs ) StartSelection( aStart ); UpdateSelection( aEnd ); } - catch( Exception& e ) + catch( Exception& ) { - (void)e; OSL_FAIL("svx::SvxTableController::onInsert(), exception caught!"); } } @@ -900,9 +899,8 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) } } } - catch( Exception& e ) + catch( Exception& ) { - (void)e; OSL_FAIL( "svx::SvxTableController::SetTableStyle(), exception caught!" ); } } @@ -911,9 +909,8 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) pModel->EndUndo(); } } - catch( Exception& e ) + catch( Exception& ) { - (void)e; OSL_FAIL( "svx::SvxTableController::SetTableStyle(), exception caught!" ); } } @@ -1637,9 +1634,8 @@ void SvxTableController::checkCell( CellPos& rPos ) if( rPos.mnRow >= mxTable->getRowCount() ) rPos.mnRow = mxTable->getRowCount()-1; } - catch( Exception& e ) + catch( Exception& ) { - (void)e; OSL_FAIL("sdr::table::SvxTableController::checkCell(), exception caught!" ); } } @@ -1656,9 +1652,8 @@ void SvxTableController::findMergeOrigin( CellPos& rPos ) ::findMergeOrigin( mxTable, rPos.mnCol, rPos.mnRow, rPos.mnCol, rPos.mnRow ); } } - catch( Exception& e ) + catch( Exception& ) { - (void)e; OSL_FAIL("sdr::table::SvxTableController::findMergeOrigin(), exception caught!" ); } } diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 65c09b0a523a..6366a49b712f 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -221,7 +221,7 @@ void SvxDrawPage::dispose() // notify subclasses to do their dispose disposing(); } - catch(::com::sun::star::uno::Exception& e) + catch(const ::com::sun::star::uno::Exception& e) { // catch exception and throw again but signal that // the object was disposed. Dispose should be called diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 8262333d7a4e..868688765e38 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -137,7 +137,7 @@ void SvxShapeCollection::dispose() // notify subclasses to do their dispose disposing(); } - catch(::com::sun::star::uno::Exception& e) + catch(const ::com::sun::star::uno::Exception& e) { // catch exception and throw again but signal that // the object was disposed. Dispose should be called diff --git a/svx/workben/msview/xmlconfig.cxx b/svx/workben/msview/xmlconfig.cxx index 3504265c134c..a1553718328d 100644 --- a/svx/workben/msview/xmlconfig.cxx +++ b/svx/workben/msview/xmlconfig.cxx @@ -339,7 +339,7 @@ void load_config( const OUString& rPath ) // finally, parser the stream xParser->parseStream( aParserInput ); } - catch( Exception& r ) + catch( Exception& ) { OSL_FAIL( (rtl::OString("load_config(), " @@ -347,8 +347,6 @@ void load_config( const OUString& rPath ) rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 )).getStr() ); - - (void)r; } } -- cgit