diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-12-30 16:41:07 +0000 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-01-10 13:41:43 +0100 |
commit | d804d22c229a9a08bd50c348a0e933b0138385bf (patch) | |
tree | bf7f76b5a0f59f53b3ada83dc66a787525a057ac /vcl | |
parent | 4de638c14c0a74e29e213fd53cd01cad93285aa4 (diff) |
tdf#122056: catch DisposedException to avoid crash w/ screen reader
The repro scenario is closing a slideshow with screen reader on.
Some object are already disposed by the time [full-screen] win with
presentation closes
Change-Id: I7e2ae7a5b694daaf7355ef93d87a998c9f2e345a
Reviewed-on: https://gerrit.libreoffice.org/65931
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5AccessibleWidget.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx index c2c1fdc2b7f8..efafab17f3cf 100644 --- a/vcl/qt5/Qt5AccessibleWidget.cxx +++ b/vcl/qt5/Qt5AccessibleWidget.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/accessibility/XAccessibleValue.hpp> #include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <comphelper/AccessibleImplementationHelper.hxx> @@ -662,8 +663,18 @@ QAccessibleInterface* Qt5AccessibleWidget::childAt(int x, int y) const { if (!m_xAccessible.is()) return nullptr; - Reference<XAccessibleComponent> xAccessibleComponent(m_xAccessible->getAccessibleContext(), - UNO_QUERY); + + Reference<XAccessibleContext> xAc; + try + { + xAc = m_xAccessible->getAccessibleContext(); + } + catch (css::lang::DisposedException /*ex*/) + { + return nullptr; + } + + Reference<XAccessibleComponent> xAccessibleComponent(xAc, UNO_QUERY); return QAccessible::queryAccessibleInterface( new Qt5XAccessible(xAccessibleComponent->getAccessibleAtPoint(awt::Point(x, y)))); } |