summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2012-01-06 00:03:58 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2012-01-06 00:22:51 +0900
commit5493951893ea90b330d5280bc171a60ff46fa396 (patch)
tree97dee1e30575dc05959acaa2cec6da9b791022d7
parent1bae43a3d75d9be75b027dab2eff12695ad4f353 (diff)
catch exception by constant reference
-rw-r--r--svl/source/config/itemholder2.cxx4
-rw-r--r--svl/source/fsstor/fsstorage.cxx2
-rw-r--r--svtools/source/config/itemholder2.cxx4
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx6
-rw-r--r--svtools/source/misc/chartprettypainter.cxx3
-rw-r--r--svtools/workben/svdem.cxx2
-rw-r--r--svtools/workben/treecontrol/treetest.cxx4
-rw-r--r--svx/source/accessibility/AccessibleShape.cxx6
-rw-r--r--svx/source/accessibility/DescriptionGenerator.cxx10
-rw-r--r--svx/source/fmcomp/gridctrl.cxx3
-rw-r--r--svx/source/svdraw/svdoashp.cxx2
-rw-r--r--svx/source/svdraw/svdoole2.cxx24
-rw-r--r--svx/source/table/tablecontroller.cxx15
-rw-r--r--svx/source/unodraw/unopage.cxx2
-rw-r--r--svx/source/unodraw/unoshcol.cxx2
-rw-r--r--svx/workben/msview/xmlconfig.cxx4
16 files changed, 38 insertions, 55 deletions
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index dc7cd36f24fe..f2545d4d564d 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -62,12 +62,12 @@ ItemHolder2::ItemHolder2()
if (xCfg.is())
xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
}
- catch(css::uno::RuntimeException& rREx)
+ catch(const css::uno::RuntimeException& rREx)
{
throw rREx;
}
#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/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 4fbc78023184..01e4434a9c0c 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -1142,7 +1142,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorage::getElementNames()
}
}
}
- catch( ucb::InteractiveIOException& r )
+ catch( const ucb::InteractiveIOException& r )
{
if ( r.Code == ucb::IOErrorCode_NOT_EXISTING )
OSL_FAIL( "The folder does not exist!\n" );
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 0105c6d2cfd7..9e9a1ab8ced3 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -69,12 +69,12 @@ ItemHolder2::ItemHolder2()
if (xCfg.is())
xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
}
- catch(css::uno::RuntimeException& rREx)
+ catch(const css::uno::RuntimeException& rREx)
{
throw rREx;
}
#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/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index fa322a79979f..7f8198435a30 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -899,9 +899,9 @@ void AssignmentPersistentData::Commit()
aTableNames = m_xCurrentDatasourceTables->getElementNames();
}
}
- catch(SQLContext& e) { aException <<= e; }
- catch(SQLWarning& e) { aException <<= e; }
- catch(SQLException& e) { aException <<= e; }
+ catch(const SQLContext& e) { aException <<= e; }
+ catch(const SQLWarning& e) { aException <<= e; }
+ catch(const SQLException& e) { aException <<= e; }
catch(Exception&)
{
OSL_FAIL("AddressBookSourceDialog::resetTables: could not retrieve the table!");
diff --git a/svtools/source/misc/chartprettypainter.cxx b/svtools/source/misc/chartprettypainter.cxx
index e74b7ea0804f..a9fd9f4e57fd 100644
--- a/svtools/source/misc/chartprettypainter.cxx
+++ b/svtools/source/misc/chartprettypainter.cxx
@@ -120,9 +120,8 @@ bool ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel > xCh
}
}
}
- catch( uno::Exception& e )
+ catch( uno::Exception& )
{
- (void)e;
OSL_FAIL( "Chart cannot be painted pretty!" );
}
return false;
diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx
index 776f67e0a97d..3989a0c8d029 100644
--- a/svtools/workben/svdem.cxx
+++ b/svtools/workben/svdem.cxx
@@ -254,7 +254,7 @@ void MyApp::Main()
Execute();
}
- catch ( com::sun::star::uno::Exception & e )
+ catch ( const com::sun::star::uno::Exception & e )
{
fprintf( stderr, "Error during bootstrapping servicemanager: %s\n" ,
rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
diff --git a/svtools/workben/treecontrol/treetest.cxx b/svtools/workben/treecontrol/treetest.cxx
index 4a9be57a3c39..53027052dd40 100644
--- a/svtools/workben/treecontrol/treetest.cxx
+++ b/svtools/workben/treecontrol/treetest.cxx
@@ -358,7 +358,7 @@ int SAL_CALL main( int argc, char **argv )
xInterface = Reference< XInterface >(
resolver->resolve( sConnectionString ), UNO_QUERY );
}
- catch ( Exception& e )
+ catch ( const Exception& e )
{
printf("Error: cannot establish a connection using '%s':\n %s\n",
OUStringToOString(sConnectionString, RTL_TEXTENCODING_ASCII_US).getStr(),
@@ -382,7 +382,7 @@ int SAL_CALL main( int argc, char **argv )
rtl::Reference< DirectoryTree >(
new DirectoryTree( xComponentContext ) )->display(ustrFileURL);
}
- catch( Exception& e )
+ catch( const Exception& e )
{
printf("Error: exception caught during test:\n %s\n",
OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr());
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("<no style>")) );
}
- catch (::com::sun::star::beans::UnknownPropertyException)
+ catch (const ::com::sun::star::beans::UnknownPropertyException &)
{
msDescription.append (
OUString(RTL_CONSTASCII_USTRINGPARAM("<unknown>")) );
@@ -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("<unknown>")) );
@@ -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("<unknown>")) );
@@ -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("<unknown>")) );
@@ -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("<unknown>")) );
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;
}
}