diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-07 17:54:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-07 18:00:54 +0100 |
commit | 444600442beb69365d47de188a30a3565c45eafc (patch) | |
tree | c7501e2a4acb9b63e3fb503dda208a8293657e15 /sc/source/ui | |
parent | e88157144d59f277190f40492790a3375acc3bbb (diff) |
coverity#706946 Uncaught exception
Change-Id: I836e353ae3a8274842465719b3d8ae82ad433375
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/vba/vbachartobjects.cxx | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx index cdb300e84fb6..1b6928a30470 100644 --- a/sc/source/ui/vba/vbachartobjects.cxx +++ b/sc/source/ui/vba/vbachartobjects.cxx @@ -43,9 +43,34 @@ public: ChartObjectEnumerationImpl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Reference< drawing::XDrawPageSupplier >& _xDrawPageSupplier, const uno::Reference< XHelperInterface >& _xParent ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( _xParent, xContext, xEnumeration ), xDrawPageSupplier( _xDrawPageSupplier ) {} virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) SAL_OVERRIDE { - uno::Reference< table::XTableChart > xTableChart( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); - // parent Object is sheet - return uno::makeAny( uno::Reference< excel::XChartObject > ( new ScVbaChartObject( m_xParent, m_xContext, xTableChart, xDrawPageSupplier ) ) ); + uno::Any ret; + + try + { + uno::Reference< table::XTableChart > xTableChart( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); + // parent Object is sheet + ret = uno::makeAny( uno::Reference< excel::XChartObject > ( new ScVbaChartObject( m_xParent, m_xContext, xTableChart, xDrawPageSupplier ) ) ); + } + catch (const lang::WrappedTargetException&) + { + throw; + } + catch (const container::NoSuchElementException&) + { + throw; + } + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception& e) + { + throw lang::WrappedTargetException( + "Error creating ScVbaChartObject!", + static_cast < OWeakObject * > ( this ), + makeAny( e ) ); + } + return ret; } }; |