Kaydet (Commit) 11291be1 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#738453 Uncaught exception

Change-Id: Id05fd31d3a62bec8d658b9ecbae484ac081b8960
üst f9c460e3
...@@ -89,13 +89,13 @@ SwVbaHeadersFooters::SwVbaHeadersFooters( const uno::Reference< XHelperInterface ...@@ -89,13 +89,13 @@ SwVbaHeadersFooters::SwVbaHeadersFooters( const uno::Reference< XHelperInterface
return 3; return 3;
} }
uno::Any SAL_CALL SwVbaHeadersFooters::Item( const uno::Any& Index1, const uno::Any& ) throw (uno::RuntimeException) uno::Any SAL_CALL SwVbaHeadersFooters::Item( const uno::Any& Index1, const uno::Any& ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{ {
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
Index1 >>= nIndex; Index1 >>= nIndex;
if( ( nIndex < 1 ) || ( nIndex > 3 ) ) if( ( nIndex < 1 ) || ( nIndex > 3 ) )
{ {
throw container::NoSuchElementException(); throw lang::IndexOutOfBoundsException();
} }
return uno::makeAny( uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, mxPageStyleProps, mbHeader, nIndex ) ) ); return uno::makeAny( uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, mxPageStyleProps, mbHeader, nIndex ) ) );
} }
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
virtual ~SwVbaHeadersFooters() {} virtual ~SwVbaHeadersFooters() {}
virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException) SAL_OVERRIDE; virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException) SAL_OVERRIDE;
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& )throw (css::uno::RuntimeException) SAL_OVERRIDE; virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException) SAL_OVERRIDE;
// XEnumerationAccess // XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) SAL_OVERRIDE; virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) SAL_OVERRIDE;
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) SAL_OVERRIDE; virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) SAL_OVERRIDE;
......
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