diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-12-15 22:46:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-19 20:46:47 +0000 |
commit | 0152535649bf6827767af47e115580b2cc1906f6 (patch) | |
tree | 868a421a52282ce62ba73295728457fadec63728 | |
parent | ed5e0a90aa445f5380a245a203caee6518d483cd (diff) |
tdf#104488 editeng,svx: throw less Accessible exceptions
For some of these functions it doesn't make sense to throw
DisposedException as they can return a sensible default value.
Particularly AccessibleShape::getAccessibleChildCount() was throwing an
exception that was never caught.
(cherry picked from commit 5a3b2111172f106378cbf78aba0fde1db3642275)
loplugin:unnecessaryoverride
(cherry picked from commit 10bf49c18d56f198e63514953a1c6e2ea17fcc9c)
Reviewed-on: https://gerrit.libreoffice.org/32187
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 0dd9e51abc5705b7ae253d3f9b284136cf1597d6)
Change-Id: I000149cf9bb0fd13f69650ad8224a8daf26f7bee
Reviewed-on: https://gerrit.libreoffice.org/32201
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | editeng/source/accessibility/AccessibleContextBase.cxx | 15 | ||||
-rw-r--r-- | include/editeng/AccessibleContextBase.hxx | 6 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleShape.cxx | 6 |
3 files changed, 5 insertions, 22 deletions
diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx index c2b0d00c7c8c..2c5bc59204be 100644 --- a/editeng/source/accessibility/AccessibleContextBase.cxx +++ b/editeng/source/accessibility/AccessibleContextBase.cxx @@ -175,7 +175,6 @@ uno::Reference< XAccessibleContext> SAL_CALL AccessibleContextBase::getAccessibleContext() throw (uno::RuntimeException, std::exception) { - ThrowIfDisposed (); return this; } @@ -188,7 +187,6 @@ sal_Int32 SAL_CALL AccessibleContextBase::getAccessibleChildCount() throw (uno::RuntimeException, std::exception) { - ThrowIfDisposed (); return 0; } @@ -420,7 +418,6 @@ void SAL_CALL AccessibleContextBase::removeAccessibleEventListener ( OUString SAL_CALL AccessibleContextBase::getImplementationName() throw (css::uno::RuntimeException, std::exception) { - ThrowIfDisposed (); return OUString("AccessibleContextBase"); } @@ -434,7 +431,6 @@ uno::Sequence< OUString > SAL_CALL AccessibleContextBase::getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) { - ThrowIfDisposed (); static const OUString sServiceNames[2] = { OUString("com.sun.star.accessibility.Accessible"), OUString("com.sun.star.accessibility.AccessibleContext") @@ -445,17 +441,6 @@ uno::Sequence< OUString > SAL_CALL // XTypeProvider -uno::Sequence< css::uno::Type> - AccessibleContextBase::getTypes() - throw (css::uno::RuntimeException, std::exception) -{ - ThrowIfDisposed (); - - // This class supports no interfaces on its own. Just return those - // supported by the base class. - return WeakComponentImplHelper::getTypes(); -} - uno::Sequence<sal_Int8> SAL_CALL AccessibleContextBase::getImplementationId() throw (css::uno::RuntimeException, std::exception) diff --git a/include/editeng/AccessibleContextBase.hxx b/include/editeng/AccessibleContextBase.hxx index 7f414ebe00dc..4fb4389cc80a 100644 --- a/include/editeng/AccessibleContextBase.hxx +++ b/include/editeng/AccessibleContextBase.hxx @@ -266,12 +266,6 @@ public: //===== XTypeProvider =================================================== - /** Returns a sequence of all supported interfaces. - */ - virtual css::uno::Sequence< css::uno::Type> SAL_CALL - getTypes() - throw (css::uno::RuntimeException, std::exception) override; - /** Returns a implementation id. */ virtual css::uno::Sequence<sal_Int8> SAL_CALL diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 45bcf70c3551..8fc86ee4d38a 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -326,7 +326,11 @@ sal_Int32 SAL_CALL AccessibleShape::getAccessibleChildCount () throw (css::uno::RuntimeException, std::exception) { - ThrowIfDisposed (); + if (IsDisposed()) + { + return 0; + } + sal_Int32 nChildCount = 0; // Add the number of shapes that are children of this shape. |