diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2011-11-23 02:21:12 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2011-11-23 02:21:44 +0900 |
commit | e2de4357f5e1bf6d7f205402f6823032c9d35b1b (patch) | |
tree | fd7e88081276983d285fa8d52fc660a4177185f9 /basic | |
parent | 799c944cc11aa6eeb20e5f24bf33434908c4556b (diff) |
catch by const reference
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/app/app.cxx | 4 | ||||
-rw-r--r-- | basic/source/classes/eventatt.cxx | 4 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 13 | ||||
-rw-r--r-- | basic/source/uno/namecont.cxx | 4 |
4 files changed, 12 insertions, 13 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index e0175696726e..71bde6baa5d2 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -198,7 +198,7 @@ uno::Reference< XContentProviderManager > InitializeUCB( void ) defaultBootstrap_InitialComponentContext()->getServiceManager(), UNO_QUERY_THROW); } - catch( com::sun::star::uno::Exception & exc ) + catch( const com::sun::star::uno::Exception & exc ) { fprintf( stderr, "Couldn't bootstrap uno servicemanager for reason : %s\n" , OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); @@ -328,7 +328,7 @@ int BasicApp::Main( ) RemoveAccel( pMainAccel ); } - catch( class Exception & rEx) + catch(const class Exception & rEx) { printf( "Exception not caught: %s\n", ByteString( String(rEx.Message), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); String aMsg( String::CreateFromAscii( "Exception not caught: " ) ); diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index d93a12ab2044..9d5f5ffbc0a5 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -151,13 +151,13 @@ void SFURL_firing_impl( const ScriptEvent& aScriptEvent, Any* pRet, const Refere *pRet = result; } } - catch ( RuntimeException& re ) + catch ( const RuntimeException& re ) { OSL_TRACE("SFURL_firing_impl() Caught RuntimeException reason %s.", ::rtl::OUStringToOString( re.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } - catch ( Exception& e ) + catch ( const Exception& e ) { OSL_TRACE("SFURL_firing_impl() Caught Exception reason %s.", ::rtl::OUStringToOString( e.Message, diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index b503f85a117d..ae9d857ec2cb 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -393,7 +393,7 @@ Any convertAny( const Any& rVal, const Type& aDestType ) implGetExceptionMsg( ::cppu::getCaughtException() ) ); return aConvertedVal; } - catch( CannotConvertException& e2 ) + catch( const CannotConvertException& e2 ) { ::rtl::OUString aCannotConvertExceptionName ( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.IllegalArgumentException" ) ); @@ -2480,7 +2480,7 @@ void SbUnoObject::doIntrospection( void ) { mxUnoAccess = xIntrospection->inspect( maTmpUnoObj ); } - catch( RuntimeException& e ) + catch( const RuntimeException& e ) { StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e ) ); } @@ -2728,7 +2728,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) unoToSbxValue( pRes, aAny ); } } - catch( NoSuchElementException& e ) + catch( const NoSuchElementException& e ) { StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e ) ); } @@ -2779,7 +2779,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) } } - catch( RuntimeException& e ) + catch( const RuntimeException& e ) { // Establish so that the exeption error will not be overwriten if( !pRes ) @@ -3476,9 +3476,8 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) unoToSbxValue( pRes, aValue ); } } - catch( NoSuchElementException& e1 ) + catch( const NoSuchElementException& ) { - ::rtl::OUString aMsg = implGetExceptionMsg( e1 ); } } @@ -4306,7 +4305,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite { aRet = xTypeAccess->getByHierarchicalName( aTypeName ); } - catch( NoSuchElementException& e1 ) + catch( const NoSuchElementException& e1 ) { ::rtl::OUString aNoSuchElementExceptionName ( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.NoSuchElementException" ) ); diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 8151b7457e38..5815e61867ba 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -820,12 +820,12 @@ sal_Bool SfxLibraryContainer::init_Impl( xParser->setDocumentHandler( ::xmlscript::importLibraryContainer( pLibArray ) ); xParser->parseStream( source ); } - catch ( xml::sax::SAXException& e ) + catch ( const xml::sax::SAXException& e ) { SAL_WARN_S("basic", e.Message); return sal_False; } - catch ( io::IOException& e ) + catch ( const io::IOException& e ) { SAL_WARN_S("basic", e.Message); return sal_False; |