From e263abafa09520765e29ce420fe8005d6f3e6fbe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 10 Oct 2014 11:40:04 +0100 Subject: coverity#706275 Uncaught exception Change-Id: I538cca9505411e8984ba821807c0072c0ce40e7b --- comphelper/source/eventattachermgr/eventattachermgr.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index 21d8c399a211..1b5c22816bf5 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -244,7 +245,6 @@ void AttacherAllListener_Impl::convertToEventReturn( Any & rRet, const Type & rR } } - // Methods of XAllListener Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Event ) throw( InvocationTargetException, RuntimeException, std::exception ) @@ -314,7 +314,7 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even break; } } - catch( CannotConvertException& ) + catch (const CannotConvertException&) { // silent ignore conversions errors from a script call Reference< XIdlClass > xListenerType = mpManager->getReflection()-> @@ -325,14 +325,22 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even Reference< XIdlClass > xRetType = xMeth->getReturnType(); Type aRetType(xRetType->getTypeClass(), xRetType->getName()); aRet.clear(); - convertToEventReturn( aRet, aRetType ); + try + { + convertToEventReturn( aRet, aRetType ); + } + catch (const CannotConvertException& e) + { + throw css::lang::WrappedTargetRuntimeException( + "wrapped CannotConvertException " + e.Message, + css::uno::Reference(), makeAny(e)); + } } } } return aRet; } - // Methods of XEventListener void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& ) throw( RuntimeException, std::exception ) @@ -340,7 +348,6 @@ void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& ) // It is up to the container to release the object } - // Constructor method for EventAttacherManager Reference< XEventAttacherManager > createEventAttacherManager( const Reference< XComponentContext > & rxContext ) throw( Exception ) -- cgit