Kaydet (Commit) 90da361c authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#706465 Uncaught exception

Change-Id: Ic328c8a68fac462c402b70f85093cd8b14d2882d
üst d8a8b5ac
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <comphelper/enumhelper.hxx> #include <comphelper/enumhelper.hxx>
#include <comphelper/extract.hxx> #include <comphelper/extract.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/ucb/CommandInfo.hpp> #include <com/sun/star/ucb/CommandInfo.hpp>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
...@@ -212,6 +213,8 @@ void SAL_CALL ODefinitionContainer::replaceByName( const OUString& _rName, const ...@@ -212,6 +213,8 @@ void SAL_CALL ODefinitionContainer::replaceByName( const OUString& _rName, const
{ {
ResettableMutexGuard aGuard(m_aMutex); ResettableMutexGuard aGuard(m_aMutex);
try
{
// let derived classes approve the new object // let derived classes approve the new object
Reference< XContent > xNewElement(aElement,UNO_QUERY); Reference< XContent > xNewElement(aElement,UNO_QUERY);
approveNewObject( _rName, xNewElement ); // will throw if necessary approveNewObject( _rName, xNewElement ); // will throw if necessary
...@@ -225,6 +228,26 @@ void SAL_CALL ODefinitionContainer::replaceByName( const OUString& _rName, const ...@@ -225,6 +228,26 @@ void SAL_CALL ODefinitionContainer::replaceByName( const OUString& _rName, const
// and dispose it // and dispose it
disposeComponent(xOldElement); 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 namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment