diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-25 15:08:11 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-25 15:09:58 +0900 |
commit | 8cc98837d30d818fe3a2e4063798c7451044eb9c (patch) | |
tree | 2da46809bc97a39489c6d57c8c855ebefb58899d /scripting | |
parent | 8b18c70b994e8239f2f0dfd549fcc27feceb413c (diff) |
catch exception by constant reference
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/protocolhandler/scripthandler.cxx | 6 | ||||
-rw-r--r-- | scripting/source/provider/BrowseNodeFactoryImpl.cxx | 2 | ||||
-rw-r--r-- | scripting/source/provider/MasterScriptProvider.cxx | 2 | ||||
-rw-r--r-- | scripting/source/provider/ProviderCache.cxx | 10 | ||||
-rw-r--r-- | scripting/source/provider/ScriptImpl.cxx | 8 | ||||
-rw-r--r-- | scripting/source/runtimemgr/ScriptNameResolverImpl.cxx | 36 | ||||
-rw-r--r-- | scripting/source/runtimemgr/ScriptRuntimeManager.cxx | 24 | ||||
-rw-r--r-- | scripting/source/runtimemgr/StorageBridge.cxx | 10 |
8 files changed, 47 insertions, 51 deletions
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 008a0e4b8c13..c1d2b2c0310a 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -299,7 +299,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( { xListener->dispatchFinished( aEvent ) ; } - catch(RuntimeException & e) + catch(const RuntimeException & e) { OSL_TRACE( "ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException" @@ -413,12 +413,12 @@ void ScriptProtocolHandler::createScriptProvider() xFac->createScriptProvider( aContext ), UNO_QUERY_THROW ); } } - catch ( RuntimeException & e ) + catch ( const RuntimeException & e ) { ::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::createScriptProvider(), " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); } - catch ( Exception & e ) + catch ( const Exception & e ) { ::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::createScriptProvider: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index abd7b7adca12..19c534cacdbc 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -327,7 +327,7 @@ Sequence< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference< locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("share")) ) ), UNO_QUERY_THROW ); } // TODO proper exception handling, should throw - catch( Exception& e ) + catch( const Exception& e ) { (void)e; OSL_TRACE("Caught Exception %s", diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 3dbde5151589..c5fe4c879285 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -243,7 +243,7 @@ void MasterScriptProvider::createPkgProvider() xFac->createScriptProvider( location ), UNO_QUERY_THROW ); } - catch ( Exception& e ) + catch ( const Exception& e ) { (void)e; OSL_TRACE("Exception creating MasterScriptProvider for uno_packages in context %s: %s", diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index e7c8e705af9d..4e6390b2a833 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -122,13 +122,9 @@ ProviderCache::getAllProviders() throw ( RuntimeException ) xScriptProvider = createProvider( h_it->second ); providers[ providerIndex++ ] = xScriptProvider; } - catch ( Exception& e ) + catch ( const Exception& ) { - ::rtl::OUString temp = OUSTR( "ProviderCache::getAllProviders: failed to create provider, " ); - temp.concat( e.Message ); DBG_UNHANDLED_EXCEPTION(); - //throw RuntimeException( temp.concat( e.Message ), - // Reference< XInterface >() ); } } } @@ -187,7 +183,7 @@ ProviderCache::populateCache() throw ( RuntimeException ) } } } - catch ( Exception &e ) + catch ( const Exception &e ) { ::rtl::OUString temp = OUSTR( "ProviderCache::populateCache: couldn't obtain XSingleComponentFactory for " ); @@ -204,7 +200,7 @@ ProviderCache::createProvider( ProviderDetails& details ) throw ( RuntimeExcepti details.provider.set( details.factory->createInstanceWithArgumentsAndContext( m_Sctx, m_xContext ), UNO_QUERY_THROW ); } - catch ( RuntimeException& e ) + catch ( const RuntimeException& e ) { ::rtl::OUString temp(RTL_CONSTASCII_USTRINGPARAM("ProviderCache::createProvider() Error creating provider from factory!!!\n")); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); diff --git a/scripting/source/provider/ScriptImpl.cxx b/scripting/source/provider/ScriptImpl.cxx index ade15a850f03..7204e8fc1b58 100644 --- a/scripting/source/provider/ScriptImpl.cxx +++ b/scripting/source/provider/ScriptImpl.cxx @@ -75,14 +75,14 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, result = m_RunTimeManager->invoke( m_ScriptURI, anyScriptingContext, aParams, aOutParamIndex, aOutParam ); } - catch ( lang::IllegalArgumentException & iae ) + catch ( const lang::IllegalArgumentException & iae ) { ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke IllegalArgumentException : " ); throw lang::IllegalArgumentException( temp.concat( iae.Message ), Reference< XInterface > (), iae.ArgumentPosition ); } - catch ( script::CannotConvertException & cce ) + catch ( const script::CannotConvertException & cce ) { ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke CannotConvertException : " ); throw script::CannotConvertException( temp.concat( cce.Message ), @@ -91,14 +91,14 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, cce.Reason, cce.ArgumentIndex ); } - catch ( reflection::InvocationTargetException & ite ) + catch ( const reflection::InvocationTargetException & ite ) { ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke InvocationTargetException : " ); throw reflection::InvocationTargetException( temp.concat( ite.Message ), Reference< XInterface > (), ite.TargetException ); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { ::rtl::OUString temp = OUSTR( "ScriptImpl::invoke RuntimeException : " ); throw RuntimeException( temp.concat( re.Message ), diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx index 5a96c3b5a2ff..a9b0ed19a070 100644 --- a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx +++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx @@ -144,7 +144,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE Reference< XInterface > () ); } } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve : problem with getPropertyValue" ); @@ -212,7 +212,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE { filesysURL = getFilesysURL( scriptURI ); } - catch ( lang::IllegalArgumentException & e ) + catch ( const lang::IllegalArgumentException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -245,7 +245,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE filesysScriptStorageID, ::rtl::OUStringToOString( filesysURL, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } - catch ( RuntimeException & e ) + catch ( const RuntimeException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -292,41 +292,41 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE } } - catch ( css::security::AccessControlException & e ) + catch ( css::security::AccessControlException & ) { // no execute permission OSL_TRACE( "ScriptNameResolverImpl::resolve : AccessControlException " ); continue; } - catch ( beans::UnknownPropertyException & e ) + catch ( const beans::UnknownPropertyException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve : UnknownPropertyException" ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface > () ); } - catch ( beans::PropertyVetoException & e ) + catch ( const beans::PropertyVetoException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve : PropertyVetoException " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface > () ); } - catch ( lang::IllegalArgumentException & e ) + catch ( const lang::IllegalArgumentException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve : IllegalArgumentException " ); throw lang::IllegalArgumentException( temp.concat( e.Message ), Reference< XInterface > (), e.ArgumentPosition ); } - catch ( lang::WrappedTargetException & e ) + catch ( const lang::WrappedTargetException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolve : WrappedTargetException " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface > () ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OSL_TRACE( "Exception thrown by storage %d, failed to match uri: %s", @@ -426,7 +426,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept { permissionURI = getFilesysURL( scriptURI ); } - catch ( lang::IllegalArgumentException & e ) + catch ( const lang::IllegalArgumentException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolveFromURI: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -449,7 +449,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept // that information was in the uri resolvedScriptInfo = results[ 0 ]; } - catch ( css::security::AccessControlException & ace ) + catch ( const css::security::AccessControlException & ace ) { OUString temp = OUSTR( "ScriptRuntimeManager::resolveURIFromStorageID AccessControlException: " ); @@ -457,7 +457,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept Reference< XInterface > (), ace.LackingPermission ); } - catch ( lang::IllegalArgumentException & iae ) + catch ( const lang::IllegalArgumentException & iae ) { OUString temp = OUSTR( "ScriptRuntimeManager::resolveURIFromStorageID IllegalArgumentException: " ); @@ -465,14 +465,14 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept Reference< XInterface > (), iae.ArgumentPosition ); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { OUString temp = OUSTR( "ScriptRuntimeManager::resolveURIFromStorageID RuntimeException: " ); throw RuntimeException( temp.concat( re.Message ), Reference< XInterface > () ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::resolveURIFromStorageID : Exception caught - RuntimeException rethrown" ); @@ -520,23 +520,23 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec Reference< XInterface > xScriptStorage( ScriptStorageManager->getScriptStorage( sid ), UNO_SET_THROW ); xScriptInfoAccess.set( xScriptStorage, UNO_QUERY_THROW ); } - catch ( lang::IllegalArgumentException & e ) + catch ( const lang::IllegalArgumentException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::getStorageInstance: " ); throw lang::IllegalArgumentException( temp.concat( e.Message ), Reference< XInterface >(), e.ArgumentPosition ); } - catch ( css::security::AccessControlException & e ) + catch ( const css::security::AccessControlException & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::getStorageInstance: AccessControlException " ); throw css::security::AccessControlException( temp.concat( e.Message ), Reference< XInterface >(), e.LackingPermission ); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { OUString temp = OUSTR( "ScriptNameResolverImpl::getStorageInstance: " ); throw RuntimeException( temp.concat( re.Message ), Reference< XInterface >() ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "ScriptNameResolverImpl::getStorageInstance: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx index 7ce4a0df5c26..929cffc213aa 100644 --- a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx +++ b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx @@ -107,7 +107,7 @@ throw( RuntimeException ) xInterface.set( m_xContext->getValueByName( buf.makeStringAndClear() ), UNO_QUERY_THROW ); xScriptInvocation.set( xInterface, UNO_QUERY_THROW ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "ScriptRuntimeManager::GetScriptRuntime: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -137,7 +137,7 @@ throw( RuntimeException ) ); xScriptNameResolver.set( xInterface, UNO_QUERY_THROW ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "ScriptRuntimeManager::GetScriptNameResolver: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -222,14 +222,14 @@ Any SAL_CALL ScriptRuntimeManager::invoke( xEL_ScriptStorageManager->disposing( event ); } } - catch ( lang::IllegalArgumentException & iae ) + catch ( const lang::IllegalArgumentException & iae ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke IllegalArgumentException: " ); throw lang::IllegalArgumentException( temp.concat( iae.Message ), Reference< XInterface > (), iae.ArgumentPosition ); } - catch ( script::CannotConvertException & cce ) + catch ( const script::CannotConvertException & cce ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke CannotConvertException: " ); throw script::CannotConvertException( temp.concat( cce.Message ), @@ -237,31 +237,31 @@ Any SAL_CALL ScriptRuntimeManager::invoke( cce.DestinationTypeClass, cce.Reason, cce.ArgumentIndex ); } - catch ( reflection::InvocationTargetException & ite ) + catch ( const reflection::InvocationTargetException & ite ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke InvocationTargetException: " ); throw reflection::InvocationTargetException( temp.concat( ite.Message ), Reference< XInterface > (), ite.TargetException ); } - catch ( beans::UnknownPropertyException & e ) + catch ( const beans::UnknownPropertyException & e ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke UnknownPropertyException: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface > () ); } - catch ( lang::WrappedTargetException & e ) + catch ( const lang::WrappedTargetException & e ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke WrappedTargetException : " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface > () ); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke RuntimeException: " ); throw RuntimeException( temp.concat( re.Message ), Reference< XInterface > () ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "ScriptRuntimeManager::invoke Exception: " ); throw RuntimeException( temp.concat( e.Message ), @@ -296,7 +296,7 @@ throw( lang::IllegalArgumentException, script::CannotConvertException, RuntimeEx { resolvedURI = xScriptNameResolver->resolve( scriptURI, invocationCtx ); } - catch ( lang::IllegalArgumentException & iae ) + catch ( const lang::IllegalArgumentException & iae ) { OUString temp = OUSTR( "ScriptRuntimeManager::resolve IllegalArgumentException: " ); @@ -304,7 +304,7 @@ throw( lang::IllegalArgumentException, script::CannotConvertException, RuntimeEx Reference< XInterface > (), iae.ArgumentPosition ); } - catch ( script::CannotConvertException & cce ) + catch ( const script::CannotConvertException & cce ) { OUString temp = OUSTR( "ScriptRuntimeManager::resolve CannotConvertException: " ); throw script::CannotConvertException( temp.concat( cce.Message ), @@ -312,7 +312,7 @@ throw( lang::IllegalArgumentException, script::CannotConvertException, RuntimeEx cce.DestinationTypeClass, cce.Reason, cce.ArgumentIndex ); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { OUString temp = OUSTR( "ScriptRuntimeManager::resolve RuntimeException: " ); throw RuntimeException( temp.concat( re.Message ), diff --git a/scripting/source/runtimemgr/StorageBridge.cxx b/scripting/source/runtimemgr/StorageBridge.cxx index 2b579a7c7781..878a96347aa4 100644 --- a/scripting/source/runtimemgr/StorageBridge.cxx +++ b/scripting/source/runtimemgr/StorageBridge.cxx @@ -59,7 +59,7 @@ StorageBridge::StorageBridge( const Reference< XComponentContext >& xContext, { initStorage(); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { OUString temp = OUSTR( "StorageBridge::StorageBridge(salIn32&): " ); throw RuntimeException( temp.concat( re.Message ), Reference< XInterface >() ); @@ -79,12 +79,12 @@ StorageBridge::initStorage() throw ( ::com::sun::star::uno::RuntimeException ) Reference< XInterface > xScriptStorage( xScriptStorageManager->getScriptStorage( m_sid ), UNO_SET_THROW ); m_xScriptInfoAccess.set( xScriptStorage, UNO_QUERY_THROW ); } - catch ( RuntimeException & re ) + catch ( const RuntimeException & re ) { OUString temp = OUSTR( "StorageBridge::StorageBridge: " ); throw RuntimeException( temp.concat( re.Message ), Reference< XInterface >() ); } - catch ( Exception & e ) + catch ( const Exception & e ) { OUString temp = OUSTR( "StorageBridge::StorageBridge: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -102,7 +102,7 @@ throw ( lang::IllegalArgumentException, { results = m_xScriptInfoAccess->getScriptLogicalNames(); } - catch ( Exception &e ) + catch ( const Exception &e ) { OUString temp = OUSTR( "StorageBridge::getScriptLogicalNames: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); @@ -121,7 +121,7 @@ throw ( lang::IllegalArgumentException, RuntimeException ) { results = m_xScriptInfoAccess->getImplementations( queryURI ); } - catch ( Exception &e ) + catch ( const Exception &e ) { OUString temp = OUSTR( "StorageBridge::getImplementations: " ); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); |