diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-06 00:03:58 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-06 00:22:51 +0900 |
commit | 5493951893ea90b330d5280bc171a60ff46fa396 (patch) | |
tree | 97dee1e30575dc05959acaa2cec6da9b791022d7 /svtools | |
parent | 1bae43a3d75d9be75b027dab2eff12695ad4f353 (diff) |
catch exception by constant reference
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/itemholder2.cxx | 4 | ||||
-rw-r--r-- | svtools/source/dialogs/addresstemplate.cxx | 6 | ||||
-rw-r--r-- | svtools/source/misc/chartprettypainter.cxx | 3 | ||||
-rw-r--r-- | svtools/workben/svdem.cxx | 2 | ||||
-rw-r--r-- | svtools/workben/treecontrol/treetest.cxx | 4 |
5 files changed, 9 insertions, 10 deletions
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()); |