Kaydet (Commit) d41bc9bd authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Thorsten Behrens

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: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst aa41e17e
......@@ -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; }
......
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