From c9a54f532e6fbe2302167a7f8cb829b397f2569c Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 24 Dec 2011 01:33:06 +0900 Subject: catch exception by constant reference --- reportdesign/source/core/sdr/RptObject.cxx | 4 ++-- reportdesign/source/filter/xml/xmlHelper.cxx | 2 +- reportdesign/source/ui/dlg/Navigator.cxx | 2 +- reportdesign/source/ui/inspection/DataProviderHandler.cxx | 4 ++-- reportdesign/source/ui/inspection/DefaultInspection.cxx | 2 +- reportdesign/source/ui/inspection/GeometryHandler.cxx | 8 ++++---- reportdesign/source/ui/inspection/ReportComponentHandler.cxx | 4 ++-- reportdesign/source/ui/misc/RptUndo.cxx | 2 +- reportdesign/source/ui/misc/UITools.cxx | 6 +++--- reportdesign/source/ui/report/FormattedFieldBeautifier.cxx | 2 +- reportdesign/source/ui/report/ReportSection.cxx | 4 ++-- reportdesign/source/ui/report/ViewsWindow.cxx | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index f1c6e4d081e0..ee502b2029f3 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -393,7 +393,7 @@ void OObjectBase::EndListening(sal_Bool /*bRemoveListener*/) { m_xReportComponent->removePropertyChangeListener( ::rtl::OUString() , m_xPropertyChangeListener ); } - catch(uno::Exception) + catch(const uno::Exception &) { OSL_FAIL("OObjectBase::EndListening: Exception caught!"); } @@ -1204,7 +1204,7 @@ void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XMod xReceiver->attachDataProvider( xDataProvider.get() ); } } - catch(uno::Exception) + catch(const uno::Exception &) { } } diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 32b07becaf11..0bddd7d140ef 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -324,7 +324,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const ::rtl::OUString& _sSty { xReportControlModel->setFontDescriptor(aFont); } - catch(beans::UnknownPropertyException){} + catch(const beans::UnknownPropertyException &){} } } catch(uno::Exception&) diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 98272cd03380..b5ecd583e0f0 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -849,7 +849,7 @@ void NavigatorTree::UserData::_propertyChanged(const beans::PropertyChangeEvent& m_pTree->SetEntryText(pEntry,lcl_getName(xProp)); } } - catch(uno::Exception) + catch(const uno::Exception &) {} } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index d3f87a2ed202..77fbcdbc897d 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -75,7 +75,7 @@ DataProviderHandler::DataProviderHandler(uno::Reference< uno::XComponentContext m_xFormComponentHandler.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.FormComponentPropertyHandler")),m_xContext),uno::UNO_QUERY_THROW); m_xTypeConverter.set(m_xContext->getServiceManager()->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter" )),m_xContext),uno::UNO_QUERY_THROW); - }catch(uno::Exception) + }catch(const uno::Exception &) { } } @@ -169,7 +169,7 @@ void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface m_xMasterDetails = new OPropertyMediator( m_xDataProvider.get(), m_xReportComponent.get(), aPropertyMediation,sal_True ); } } - catch(uno::Exception) + catch(const uno::Exception &) { throw lang::NullPointerException(); } diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx index 94b1928a1951..3d00aac04d3b 100644 --- a/reportdesign/source/ui/inspection/DefaultInspection.cxx +++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx @@ -266,7 +266,7 @@ namespace rptui { m_xComponent.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.DefaultFormComponentInspectorModel")),m_xContext),UNO_QUERY_THROW); } - catch(Exception) + catch(const Exception &) { return 0; } diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index fe765ca001d9..45a698c4b58f 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -359,7 +359,7 @@ void SAL_CALL GeometryHandler::inspect( const uno::Reference< uno::XInterface > if ( xSection.is() ) lcl_collectFunctionNames( xSection, m_aFunctionNames ); } - catch(uno::Exception) + catch(const uno::Exception &) { throw lang::NullPointerException(); } @@ -1607,9 +1607,9 @@ bool GeometryHandler::impl_dialogFilter_nothrow( ::rtl::OUString& _out_rSelected if ( bSuccess ) _out_rSelectedClause = xComposer->getFilter(); } - catch (sdb::SQLContext& e) { aErrorInfo = e; } - catch (sdbc::SQLWarning& e) { aErrorInfo = e; } - catch (sdbc::SQLException& e) { aErrorInfo = e; } + catch (const sdb::SQLContext& e) { aErrorInfo = e; } + catch (const sdbc::SQLWarning& e) { aErrorInfo = e; } + catch (const sdbc::SQLException& e) { aErrorInfo = e; } catch( const uno::Exception& ) { OSL_FAIL( "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" ); diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx index 36d951486dc3..5ae7b0285535 100644 --- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx +++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx @@ -56,7 +56,7 @@ ReportComponentHandler::ReportComponentHandler(uno::Reference< uno::XComponentCo { m_xFormComponentHandler.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.FormComponentPropertyHandler")),m_xContext),uno::UNO_QUERY_THROW); - }catch(uno::Exception) + }catch(const uno::Exception &) { } } @@ -134,7 +134,7 @@ void SAL_CALL ReportComponentHandler::inspect(const uno::Reference< uno::XInterf xProp->setPropertyValue(sRowSet,xNameCont->getByName(sRowSet)); } } - catch(uno::Exception) + catch(const uno::Exception &) { throw lang::NullPointerException(); } diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx index 2f96dae6f5b7..c481463a0b1f 100644 --- a/reportdesign/source/ui/misc/RptUndo.cxx +++ b/reportdesign/source/ui/misc/RptUndo.cxx @@ -154,7 +154,7 @@ OSectionUndo::~OSectionUndo() { comphelper::disposeComponent(xShape); } - catch(uno::Exception) + catch(const uno::Exception &) { OSL_FAIL("Exception caught!"); } diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 48195584d765..094960600ec5 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -1051,9 +1051,9 @@ bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula } } } - catch (sdb::SQLContext& e) { aErrorInfo = e; } - catch (sdbc::SQLWarning& e) { aErrorInfo = e; } - catch (sdbc::SQLException& e) { aErrorInfo = e; } + catch (const sdb::SQLContext& e) { aErrorInfo = e; } + catch (const sdbc::SQLWarning& e) { aErrorInfo = e; } + catch (const sdbc::SQLException& e) { aErrorInfo = e; } catch( const uno::Exception& ) { OSL_FAIL( "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" ); diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx index 95de847efb5a..fcdeb2627d94 100644 --- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx +++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx @@ -120,7 +120,7 @@ namespace rptui if ( xControlModel.is() ) setPlaceholderText( getVclWindowPeer( xControlModel.get() ), sDataField ); } - catch (uno::Exception) + catch (const uno::Exception &) { DBG_UNHANDLED_EXCEPTION(); } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 06ad80507e8e..dbc67153513a 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -606,9 +606,9 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I } } } - catch(uno::Exception) + catch(const uno::Exception &) { - OSL_FAIL("Exception caught: OReportSection::_propertyChanged("); + OSL_FAIL("Exception caught: OReportSection::impl_adjustObjectSizePosition()"); } } //------------------------------------------------------------------------------ diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 735b8ebb6c98..8de44eead00b 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -738,7 +738,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles, getStyleProperty(xReportDefinition,PROPERTY_PAPERSIZE).Width - getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN), xSection->getHeight())); } - catch(uno::Exception){} + catch(const uno::Exception &){} } } else -- cgit