summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2011-12-26 03:38:13 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2011-12-26 03:38:50 +0900
commit5451e9c702afb7c570662c740b33f2481abb7cb1 (patch)
treeef491adee50b35a977830dc9431eb308434cce4e
parentbf2857d88af137ba15939d81970be92b0310c915 (diff)
catch exception by constant reference
-rw-r--r--sdext/source/pdfimport/pdfiadaptor.cxx2
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfparse.cxx4
-rw-r--r--sdext/source/presenter/PresenterConfigurationAccess.cxx4
-rw-r--r--sdext/source/presenter/PresenterScreen.cxx5
-rw-r--r--sfx2/qa/cppunit/test_metadatable.cxx4
-rw-r--r--sfx2/source/appl/appserv.cxx2
-rw-r--r--sfx2/source/appl/workwin.cxx4
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx2
-rw-r--r--sfx2/source/menu/thessubmenu.cxx6
-rw-r--r--sfx2/source/view/ipclient.cxx6
-rw-r--r--shell/source/backends/desktopbe/desktopbackend.cxx2
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx2
-rw-r--r--shell/source/unix/exec/shellexec.cxx2
-rw-r--r--soltools/adjustvisibility/adjustvisibility.cxx4
-rw-r--r--sot/source/sdstor/ucbstorage.cxx10
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.cxx2
-rw-r--r--starmath/source/mathmlimport.cxx5
-rw-r--r--starmath/source/smdetect.cxx2
19 files changed, 33 insertions, 37 deletions
diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx
index a8720def318b..1fc25d85932b 100644
--- a/sdext/source/pdfimport/pdfiadaptor.cxx
+++ b/sdext/source/pdfimport/pdfiadaptor.cxx
@@ -163,7 +163,7 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert
m_xContext ),
uno::UNO_QUERY );
}
- catch(uno::Exception& e)
+ catch(const uno::Exception& e)
{
(void)e;
OSL_TRACE( "subfilter exception: %s\n",
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index beecd3c8f23c..1638f523485f 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -577,7 +577,7 @@ PDFEntry* PDFReader::read( const char* pBuffer, unsigned int nLen )
(int)aInfo.length );
#endif
}
- catch( parser_error<const char*, const char*>& rError )
+ catch( const parser_error<const char*, const char*>& rError )
{
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "parse error: %s at buffer pos %u\nobject stack:\n",
@@ -657,7 +657,7 @@ PDFEntry* PDFReader::read( const char* pFileName )
(int)aInfo.length );
#endif
}
- catch( parser_error< const char*, file_iterator<> >& rError )
+ catch( const parser_error< const char*, file_iterator<> >& rError )
{
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "parse error: %s at buffer pos %u\nobject stack:\n",
diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx
index 5bdbed248217..36333b0d8ade 100644
--- a/sdext/source/presenter/PresenterConfigurationAccess.cxx
+++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx
@@ -90,7 +90,7 @@ PresenterConfigurationAccess::PresenterConfigurationAccess (
maNode <<= mxRoot;
}
}
- catch (Exception& rException)
+ catch (const Exception& rException)
{
OSL_TRACE ("caught exception while opening configuration: %s",
::rtl::OUStringToOString(rException.Message,
@@ -195,7 +195,7 @@ Any PresenterConfigurationAccess::GetConfigurationNode (
return rxNode->getByHierarchicalName(sPathToNode);
}
}
- catch (Exception& rException)
+ catch (const Exception& rException)
{
OSL_TRACE ("caught exception while getting configuration node %s: %s",
::rtl::OUStringToOString(sPathToNode, RTL_TEXTENCODING_UTF8).getStr(),
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index f904ab122fd9..82e3fcd5075a 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -511,7 +511,7 @@ void PresenterScreen::SwitchMonitors()
uno::Any aDisplay;
aDisplay <<= nNewScreen;
xProperties->setPropertyValue(A2S("Display"), aDisplay);
- } catch (const uno::Exception &e) {
+ } catch (const uno::Exception &) {
}
}
@@ -873,9 +873,8 @@ void PresenterScreen::ProcessComponent (
nY+nHeight);
}
}
- catch (Exception& e)
+ catch (const Exception&)
{
- (void)e;
OSL_ASSERT(false);
}
}
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx
index b23bad29b036..eb239f7743f0 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -134,7 +134,7 @@ void MetadatableTest::test()
try {
m2.SetMetadataReference(id1);
CPPUNIT_ASSERT_MESSAGE("set duplicate succeeded", false);
- } catch (lang::IllegalArgumentException) { }
+ } catch (const lang::IllegalArgumentException &) { }
m1.SetMetadataReference(id1);
CPPUNIT_ASSERT_MESSAGE("set failed (existing)",
m1.GetMetadataReference() == id1);
@@ -205,7 +205,7 @@ void MetadatableTest::test()
try {
mc2.SetMetadataReference(id2);
CPPUNIT_FAIL("set duplicate succeeded");
- } catch (lang::IllegalArgumentException) { }
+ } catch (const lang::IllegalArgumentException &) { }
mc1.SetMetadataReference(id2);
CPPUNIT_ASSERT_MESSAGE("set failed (existing)",
mc1.GetMetadataReference() == id2);
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index b78acb8382e0..33c8932f3e9d 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -572,7 +572,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
aValue >>= xLayoutManager;
}
- catch ( ::com::sun::star::uno::RuntimeException& e )
+ catch ( const ::com::sun::star::uno::RuntimeException& e )
{
throw e;
}
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 3eb2ebec7b89..f40009626d72 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -201,7 +201,7 @@ void LayoutManagerListener::setFrame( const css::uno::Reference< css::frame::XFr
catch ( css::lang::DisposedException& )
{
}
- catch ( css::uno::RuntimeException& e )
+ catch ( const css::uno::RuntimeException& e )
{
throw e;
}
@@ -262,7 +262,7 @@ throw( css::uno::RuntimeException )
catch ( css::lang::DisposedException& )
{
}
- catch ( css::uno::RuntimeException& e )
+ catch ( const css::uno::RuntimeException& e )
{
throw e;
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index acaf9f2d4850..9563f58c417e 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -668,7 +668,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// if the document is a new one then it appeares in the picklist immediatelly
// after SaveAs operation triggered from GUI
}
- catch( task::ErrorCodeIOException& aErrorEx )
+ catch( const task::ErrorCodeIOException& aErrorEx )
{
nErrorCode = (sal_uInt32)aErrorEx.ErrCode;
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1f571d9fa789..a8a73111d12d 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -877,7 +877,7 @@ uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo
((SfxBaseModel*)this)->m_pData->m_xDocumentInfo = xDocInfo;
} catch (uno::RuntimeException &) {
throw;
- } catch (uno::Exception & e) {
+ } catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxBaseModel::getDocumentInfo: cannot initialize")), *this,
uno::makeAny(e));
diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx
index 01792d7edf03..39ba8a30533a 100644
--- a/sfx2/source/menu/thessubmenu.cxx
+++ b/sfx2/source/menu/thessubmenu.cxx
@@ -148,9 +148,8 @@ SfxThesSubMenuHelper::SfxThesSubMenuHelper()
"com.sun.star.linguistic2.LinguServiceManager" ))), uno::UNO_QUERY_THROW );
m_xThesarus = m_xLngMgr->getThesaurus();
}
- catch (uno::Exception &e)
+ catch (const uno::Exception &)
{
- (void) e;
DBG_ASSERT( 0, "failed to get thesaurus" );
}
}
@@ -204,9 +203,8 @@ bool SfxThesSubMenuHelper::GetMeanings(
bHasMoreSynonyms |= i < nMeanings; // any meaning skipped?
}
- catch (uno::Exception &e)
+ catch (const uno::Exception &)
{
- (void) e;
DBG_ASSERT( 0, "failed to get synonyms" );
}
}
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 99d184532e1f..e2b408f0608f 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -279,7 +279,7 @@ void SAL_CALL SfxInPlaceClient_Impl::saveObject()
xStatusIndicator = xStatusIndicatorFactory->createStatusIndicator();
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IndicatorInterception" )), uno::makeAny( xStatusIndicator ));
}
- catch ( uno::RuntimeException& e )
+ catch ( const uno::RuntimeException& e )
{
throw e;
}
@@ -309,7 +309,7 @@ void SAL_CALL SfxInPlaceClient_Impl::saveObject()
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IndicatorInterception" )), uno::makeAny( xStatusIndicator ));
}
}
- catch ( uno::RuntimeException& e )
+ catch ( const uno::RuntimeException& e )
{
throw e;
}
@@ -948,7 +948,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
sal_False,
::rtl::OUString() );
}
- catch( task::ErrorCodeIOException& aErrorEx )
+ catch( const task::ErrorCodeIOException& aErrorEx )
{
nError = (sal_uInt32)aErrorEx.ErrCode;
}
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
index 8bbe89feae3c..12f6471234a2 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -213,7 +213,7 @@ css::uno::Reference< css::uno::XInterface > createBackend(
} catch (css::uno::RuntimeException &) {
// Assuming these exceptions are real errors:
throw;
- } catch (css::uno::Exception & e) {
+ } catch (const css::uno::Exception & e) {
// Assuming these exceptions indicate that the service is not installed:
OSL_TRACE(
"createInstance(%s) failed with %s",
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index aa95eec844de..91f270e2be9e 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -596,7 +596,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
std::cout << ex.what() << std::endl;
}
- catch(std::exception& ex)
+ catch(const std::exception& ex)
{
std::cout << ex.what() << std::endl;
ShowUsage();
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index db4570f193d6..39eed5a33242 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -118,7 +118,7 @@ ShellExec::ShellExec( const Reference< XComponentContext >& xContext ) :
m_aDesktopEnvironment = OUStringToOString(aDesktopEnvironment, RTL_TEXTENCODING_ASCII_US);
}
}
- } catch (RuntimeException e) {
+ } catch (const RuntimeException &e) {
}
}
diff --git a/soltools/adjustvisibility/adjustvisibility.cxx b/soltools/adjustvisibility/adjustvisibility.cxx
index 088e8ab404fe..a6e7c24dd449 100644
--- a/soltools/adjustvisibility/adjustvisibility.cxx
+++ b/soltools/adjustvisibility/adjustvisibility.cxx
@@ -218,7 +218,7 @@ void adjustVisibility( const std::string& rFile, int fd, bool bVerbose)
}
elf_end(pElf);
- } catch (ElfError& e) {
+ } catch (const ElfError& e) {
close(fd);
throw;
}
@@ -302,7 +302,7 @@ int main(int argc, char* argv[])
processObject(std::string(argv[optind]), bPreserve, bVerbose);
}
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
std::cerr << argv[0] << ": " << e.what() << "\n";
return 1;
}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 6fdf5fb84e26..bc2f10004955 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -881,7 +881,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary()
} while( aReaded == 32000 );
}
#if OSL_DEBUG_LEVEL > 1
- catch( Exception & e )
+ catch( const Exception & e )
{
OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
#else
@@ -924,7 +924,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength )
m_bSourceRead = sal_False;
}
#if OSL_DEBUG_LEVEL > 1
- catch( Exception & e )
+ catch( const Exception & e )
{
OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
#else
@@ -982,7 +982,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
memcpy( pData, aData.getArray(), aReaded );
}
#if OSL_DEBUG_LEVEL > 1
- catch( Exception & e )
+ catch( const Exception & e )
{
OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
#else
@@ -1990,7 +1990,7 @@ void UCBStorage_Impl::ReadContent()
}
}
}
- catch ( InteractiveIOException& r )
+ catch ( const InteractiveIOException& r )
{
if ( r.Code != IOErrorCode_NOT_EXISTING )
SetError( ERRCODE_IO_GENERAL );
@@ -2456,7 +2456,7 @@ sal_Int16 UCBStorage_Impl::Commit()
SetError( ERRCODE_IO_GENERAL );
return COMMIT_RESULT_FAILURE;
}
- catch ( InteractiveIOException& r )
+ catch ( const InteractiveIOException& r )
{
if ( r.Code == IOErrorCode_ACCESS_DENIED || r.Code == IOErrorCode_LOCKING_VIOLATION )
SetError( ERRCODE_IO_ACCESSDENIED );
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx
index bd3fd206df95..ce4c6a7931ad 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -365,7 +365,7 @@ void SAL_CALL OLESimpleStorage::insertByName( const ::rtl::OUString& aName, cons
{
throw;
}
- catch( uno::Exception& e )
+ catch( const uno::Exception& e )
{
throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Insert has failed!" ) ),
uno::Reference< uno::XInterface >(),
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 92901276eb8c..4a7e1b7706d2 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -348,7 +348,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent(
if ( bEncrypted )
nError = ERRCODE_SFX_WRONGPASSWORD;
}
- catch( xml::sax::SAXException& r )
+ catch( const xml::sax::SAXException& r )
{
packages::zip::ZipIOException aBrokenPackage;
if ( r.WrappedException >>= aBrokenPackage )
@@ -3004,9 +3004,8 @@ void SmXMLImport::SetConfigurationSettings(const Sequence<PropertyValue>& aConfP
if ( xInfo->hasPropertyByName( pValues->Name ) )
xProps->setPropertyValue( pValues->Name, pValues->Value );
}
- catch (beans::PropertyVetoException &e)
+ catch (const beans::PropertyVetoException &)
{
- (void) e;
// dealing with read-only properties here. Nothing to do...
}
catch( Exception& )
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index c971a1b92c3d..3920a7272e83 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -239,7 +239,7 @@ SmFilterDetect::~SmFilterDetect()
aTmpFilterName = pFilter->GetName();
aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pFilter ? pFilter->IsAllowedAsTemplate() : sal_False, &aTmpFilterName );
}
- catch( lang::WrappedTargetException& aWrap )
+ catch( const lang::WrappedTargetException& aWrap )
{
packages::zip::ZipIOException aZipException;