diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-27 20:47:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-28 10:31:26 +0000 |
commit | d54775f2c2146e1687140554bd903cc38be00054 (patch) | |
tree | 6ce3d420332cb3ef8f7757673c5d20fac4835626 /sc/source/ui | |
parent | 9a3b6aec3eca28f92d8cdb0e2a9bbcadfa7d6bc0 (diff) |
coverity#1233509 Uncaught exception
Change-Id: I09087bb872446d426e3556a64745d3faad254f9b
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/vba/vbastyles.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index 44de5c97f3b0..99953ee2db47 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -18,6 +18,7 @@ */ #include "vbastyles.hxx" #include "vbastyle.hxx" +#include <cppuhelper/exc_hlp.hxx> #include <ooo/vba/excel/XRange.hpp> using namespace ::ooo::vba; @@ -80,9 +81,31 @@ public: } virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) SAL_OVERRIDE { + try + { if ( nIndex < m_xIndexAccess->getCount() ) return lcl_createAPIStyleToVBAObject( m_xIndexAccess->getByIndex( nIndex++ ), m_xParent, m_xContext, m_xModel ); - throw container::NoSuchElementException(); + } + catch (const container::NoSuchElementException&) + { + throw; + } + catch (const lang::WrappedTargetException&) + { + throw; + } + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception& e) + { + css::uno::Any a(cppu::getCaughtException()); + throw css::lang::WrappedTargetException( + "wrapped Exception " + e.Message, + css::uno::Reference<css::uno::XInterface>(), a); + } + throw container::NoSuchElementException(); } }; |