diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-17 11:59:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-17 16:39:20 +0100 |
commit | d2a3b21ade0896520440eef15a88216d995d0ee9 (patch) | |
tree | 19c2b357bc1e40f94eaf6551cf00b158e9369fd9 | |
parent | 7a3f09216e4708391b802b0f26e87baa05393ef0 (diff) |
coverity#1132709 Uncaught exception
Change-Id: If828f82e36d12ceca7e6392de5757a131c99462c
5 files changed, 26 insertions, 4 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index da5e7c2ef07d..b02d4b6068bb 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1231,7 +1231,7 @@ namespace accessibility return OCommonAccessibleText::getCharacter( nIndex ); } - uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& rRequestedAttributes ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception) + uno::Sequence< beans::PropertyValue > SAL_CALL AccessibleEditableTextPara::getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& rRequestedAttributes ) throw (lang::IndexOutOfBoundsException, beans::UnknownPropertyException, uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; diff --git a/include/editeng/AccessibleEditableTextPara.hxx b/include/editeng/AccessibleEditableTextPara.hxx index 329783e716fe..0764d703e270 100644 --- a/include/editeng/AccessibleEditableTextPara.hxx +++ b/include/editeng/AccessibleEditableTextPara.hxx @@ -119,7 +119,7 @@ namespace accessibility virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/offapi/com/sun/star/accessibility/XAccessibleText.idl b/offapi/com/sun/star/accessibility/XAccessibleText.idl index ec1b61b58a4c..c99a58682ee2 100644 --- a/offapi/com/sun/star/accessibility/XAccessibleText.idl +++ b/offapi/com/sun/star/accessibility/XAccessibleText.idl @@ -27,6 +27,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.idl> #include <com/sun/star/lang/IllegalArgumentException.idl> #include <com/sun/star/beans/PropertyValue.idl> +#include <com/sun/star/beans/UnknownPropertyException.idl> #include <com/sun/star/accessibility/TextSegment.idl> module com { module sun { module star { module accessibility { @@ -167,7 +168,8 @@ interface XAccessibleText : ::com::sun::star::uno::XInterface getCharacterAttributes ( [in] long nIndex, [in] sequence<string> aRequestedAttributes) - raises (::com::sun::star::lang::IndexOutOfBoundsException); + raises (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::beans::UnknownPropertyException); /** Return the bounding box of the specified position. diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java index 8e8d4e9ba2c6..ce54ea09c6b9 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java @@ -444,6 +444,10 @@ public class _XAccessibleEditableText extends MultiMethodTest { } catch(com.sun.star.lang.IndexOutOfBoundsException e) { log.println("expected exception => OK"); res &= true; + } catch(com.sun.star.beans.UnknownPropertyException e) { + log.println("unexpected exception => FAILED"); + e.printStackTrace(log); + res &= false; } try { @@ -483,6 +487,10 @@ public class _XAccessibleEditableText extends MultiMethodTest { log.println("unexpected exception => FAILED"); e.printStackTrace(log); res &= false; + } catch(com.sun.star.beans.UnknownPropertyException e) { + log.println("unexpected exception => FAILED"); + e.printStackTrace(log); + res &= false; } tRes.tested("setAttributes()", res); @@ -532,4 +540,4 @@ public class _XAccessibleEditableText extends MultiMethodTest { protected void after() { oObj.setText(initialText); } -}
\ No newline at end of file +} diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java index da9e379b32b0..9f4f5c090450 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java @@ -292,6 +292,10 @@ public class _XAccessibleText extends MultiMethodTest { } catch (com.sun.star.lang.IndexOutOfBoundsException e) { log.println("Expected exception"); res &= true; + } catch(com.sun.star.beans.UnknownPropertyException e) { + log.println("unexpected exception => FAILED"); + e.printStackTrace(log); + res &= false; } try { @@ -302,6 +306,10 @@ public class _XAccessibleText extends MultiMethodTest { } catch (com.sun.star.lang.IndexOutOfBoundsException e) { log.println("Expected exception"); res &= true; + } catch(com.sun.star.beans.UnknownPropertyException e) { + log.println("unexpected exception => FAILED"); + e.printStackTrace(log); + res &= false; } try { @@ -315,6 +323,10 @@ public class _XAccessibleText extends MultiMethodTest { log.println("Unexpected exception"); e.printStackTrace(log); res &= false; + } catch(com.sun.star.beans.UnknownPropertyException e) { + log.println("unexpected exception => FAILED"); + e.printStackTrace(log); + res &= false; } tRes.tested("getCharacterAttributes()", res); |