diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-09-07 20:08:57 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-08 10:05:46 +0200 |
commit | 8e6b7d5696378e946e904c1df87da83e139af90d (patch) | |
tree | 0123df6dc844b37f04a4424020b7ddca662b6f8e /vcl/inc | |
parent | a194b7169727edfdad6936facb910f11d0d2d6f9 (diff) |
tdf#136323 qt5: Remember accessible object
'QAccessibleCache::insert' from the Qt library has a
'Q_ASSERT' checking that the corresponding 'QObject' for
which the 'QAccessibleInterface' provides information
is actually the same as the object passed as a parameter:
QAccessible::Id QAccessibleCache::insert(QObject *object, QAccessibleInterface *iface) const
{
// ...
QObject *obj = iface->object();
-> Q_ASSERT(object == obj);
However, 'Qt5AccessibleWidget::object' so far was always returning
'nullptr', triggering this assert when using a Qt version
not built with 'QT_NO_DEBUG'.
To fix this, remember and return the object as needed.
Change-Id: I4015b4c37aa8a073b02465df580a7235884e6cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102196
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 4461d49c6cfce22c2c96185b0a1d07bfe9709268)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102126
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/qt5/Qt5AccessibleWidget.hxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/inc/qt5/Qt5AccessibleWidget.hxx b/vcl/inc/qt5/Qt5AccessibleWidget.hxx index 6b0d71cba9f5..0f62d2a8a5b8 100644 --- a/vcl/inc/qt5/Qt5AccessibleWidget.hxx +++ b/vcl/inc/qt5/Qt5AccessibleWidget.hxx @@ -41,7 +41,8 @@ class VCLPLUG_QT5_PUBLIC Qt5AccessibleWidget : public QObject, Q_OBJECT public: - Qt5AccessibleWidget(const css::uno::Reference<css::accessibility::XAccessible> xAccessible); + Qt5AccessibleWidget(const css::uno::Reference<css::accessibility::XAccessible> xAccessible, + QObject* pObject); QWindow* window() const override; int childCount() const override; int indexOfChild(const QAccessibleInterface* child) const override; @@ -137,6 +138,7 @@ public: private: css::uno::Reference<css::accessibility::XAccessible> m_xAccessible; css::uno::Reference<css::accessibility::XAccessibleContext> getAccessibleContextImpl() const; + QObject* m_pObject; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |