diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-02-10 14:49:23 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-02-10 14:49:23 +0100 |
commit | 5b8947a093216a546881a749dec8d637ff1b7dd1 (patch) | |
tree | fda1695b871d5599af8d00c3f55b8b329bff9f87 | |
parent | eb01f58edde8513550744576649a5c08f807ef72 (diff) |
coverity#1268024 coverity#1267686: basctl: uncaught exception
DlgEdObj::_propertyChange() should have same exception spec. as
XPropertyChangeListener::propertyChange().
Change-Id: I8d5b628b7cc382dae55a9e17bf813fba647453eb
-rw-r--r-- | basctl/source/dlged/dlgedobj.cxx | 15 | ||||
-rw-r--r-- | basctl/source/inc/dlgedobj.hxx | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index 017bf2018133..7d11c5a8f448 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/awt/XVclContainerPeer.hpp> #include <com/sun/star/container/XContainer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/script/XScriptEventsSupplier.hpp> #include <o3tl/compat_functional.hxx> #include <unotools/sharedunocomponent.hxx> @@ -1121,7 +1122,7 @@ void DlgEdObj::EndListening(bool bRemoveListener) } } -void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(css::container::NoSuchElementException, css::uno::RuntimeException, std::exception) +void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (css::uno::RuntimeException, std::exception) { if (isListening()) { @@ -1151,7 +1152,17 @@ void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::Propert else if ( evt.PropertyName == DLGED_PROP_NAME ) { if (!dynamic_cast<DlgEdForm*>(this)) - NameChange(evt); + { + try + { + NameChange(evt); + } + catch (container::NoSuchElementException const& e) + { + throw lang::WrappedTargetRuntimeException("", nullptr, + uno::makeAny(e)); + } + } } // update step else if ( evt.PropertyName == DLGED_PROP_STEP ) diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index c75431c7fff6..0bbd9d5fc7d5 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -121,7 +121,7 @@ public: void SAL_CALL TabIndexChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw( ::com::sun::star::uno::RuntimeException); // PropertyChangeListener - void SAL_CALL _propertyChange(const css::beans::PropertyChangeEvent& evt) throw (css::container::NoSuchElementException, css::uno::RuntimeException, std::exception); + void SAL_CALL _propertyChange(const css::beans::PropertyChangeEvent& evt) throw (css::uno::RuntimeException, std::exception); // ContainerListener void SAL_CALL _elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); |