diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-27 20:29:53 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-28 10:31:25 +0000 |
commit | 90da361cbc3287719d9019146537e3560c481ecb (patch) | |
tree | f4e75b52a7aedec5f3279deb48fc7b5454cd2430 /dbaccess/source | |
parent | d8a8b5ac59990e043b1f9d8344b6a644d05367fc (diff) |
coverity#706465 Uncaught exception
Change-Id: Ic328c8a68fac462c402b70f85093cd8b14d2882d
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/dataaccess/definitioncontainer.cxx | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index 9f845737bc03..64c798c73c82 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -29,6 +29,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/enumhelper.hxx> #include <comphelper/extract.hxx> +#include <cppuhelper/exc_hlp.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/ucb/CommandInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -212,19 +213,41 @@ void SAL_CALL ODefinitionContainer::replaceByName( const OUString& _rName, const { ResettableMutexGuard aGuard(m_aMutex); - // let derived classes approve the new object - Reference< XContent > xNewElement(aElement,UNO_QUERY); - approveNewObject( _rName, xNewElement ); // will throw if necessary + try + { + // let derived classes approve the new object + Reference< XContent > xNewElement(aElement,UNO_QUERY); + approveNewObject( _rName, xNewElement ); // will throw if necessary - // the old element (for the notifications) - Reference< XContent > xOldElement = implGetByName( _rName, impl_haveAnyListeners_nothrow() ); + // the old element (for the notifications) + Reference< XContent > xOldElement = implGetByName( _rName, impl_haveAnyListeners_nothrow() ); - notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ApproveListeners ); - implReplace( _rName, xNewElement ); - notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ContainerListemers ); + notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ApproveListeners ); + implReplace( _rName, xNewElement ); + notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ContainerListemers ); - // and dispose it - disposeComponent(xOldElement); + // and dispose it + disposeComponent(xOldElement); + } + catch (const RuntimeException&) + { + throw; + } + catch (const NoSuchElementException&) + { + throw; + } + catch (const WrappedTargetException&) + { + throw; + } + catch (const Exception& e) + { + css::uno::Any a(cppu::getCaughtException()); + throw css::lang::WrappedTargetException( + "wrapped Exception " + e.Message, + css::uno::Reference<css::uno::XInterface>(), a); + } } namespace |