summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-12-18 18:31:08 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-12-18 22:46:50 +0100
commitd41bc9bd9359eb83f807fdfa72dbde0831f39be8 (patch)
tree8d78fec9a6e7def17802e7d722b7ba60c2e718b3
parentaa41e17e809a5398974b3b5f53a41c6632df284c (diff)
tdf#122055: catch RuntimeException if a11y context no longer alive
otherwise Desktop::Main will do it and soffice will crash w/ empty error msg Change-Id: I56768909227a6ff158ae353e1eff9b249d6ba9d4 Reviewed-on: https://gerrit.libreoffice.org/65357 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--vcl/qt5/Qt5AccessibleWidget.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index 9773b2875050..c2c1fdc2b7f8 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -636,7 +636,22 @@ void* Qt5AccessibleWidget::interface_cast(QAccessible::InterfaceType t)
bool Qt5AccessibleWidget::isValid() const
{
- return m_xAccessible.is() && m_xAccessible->getAccessibleContext().is();
+ if (m_xAccessible.is())
+ {
+ try
+ {
+ // getAccessibleContext throws RuntimeException if context is no longer alive
+ Reference<XAccessibleContext> xAc = m_xAccessible->getAccessibleContext();
+ return xAc.is();
+ }
+ // so let's catch it here, cuz otherwise soffice falls flat on its face
+ // with FatalError and nothing else
+ catch (css::uno::RuntimeException /*ex*/)
+ {
+ return false;
+ }
+ }
+ return false;
}
QObject* Qt5AccessibleWidget::object() const { return nullptr; }