[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - vcl/qt5

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 16 21:30:53 UTC 2019


 vcl/qt5/Qt5AccessibleWidget.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit bbbd939a84b2a5e5a0b6e2d4ad929afe7f7f52e9
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Tue Dec 18 18:31:08 2018 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jan 16 22:30:29 2019 +0100

    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 at CIB.de>
    (cherry picked from commit d41bc9bd9359eb83f807fdfa72dbde0831f39be8)
    Reviewed-on: https://gerrit.libreoffice.org/65384
    (cherry picked from commit 20da54d941083a947d8890c2f6b0e8edf3bc9ed5)
    Reviewed-on: https://gerrit.libreoffice.org/66460
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index a31e13f49e3e..73bfdb7e21ab 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -633,7 +633,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; }


More information about the Libreoffice-commits mailing list