summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2024-01-16 19:24:56 +0100
committerAndras Timar <andras.timar@collabora.com>2024-01-20 19:22:44 +0100
commit619a6fd66877fc12ca26676dd0bc6c87716222d5 (patch)
treeeeae9a39eebae8f2444a11d243e2c3f778b7e84d /vcl
parentbee01278fe304e61678b84adc72583c53cfc948f (diff)
tdf#159213: fix Base crash when choosing "Help" in relations design (kf5)
There are 2 parts here: 1) in vcl/qt5: - for release versions: avoid to call QtAccessibleRegistry::getQObject on a null object - for debug version: add an assertion on object to check it's not null 2) in svtools: the specific root cause was in EditBrowseBox::DeactivateCell, we must check m_aImpl->m_xActiveCell in addition to isAccessibleAlive() Import remark: I had a very naive/bandaid patch at the beginning this one is entirely thanks to Michael Weghorn Change-Id: I90214e9c5b7c0aa45481915d7be6020a7dc8c42e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162182 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins (cherry picked from commit 1a637a07a0fb23f4d4bfac69378caff7ee965737) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162141
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/QtAccessibleEventListener.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/qt5/QtAccessibleEventListener.cxx b/vcl/qt5/QtAccessibleEventListener.cxx
index d6a404e6947e..0bf4dcddbf2d 100644
--- a/vcl/qt5/QtAccessibleEventListener.cxx
+++ b/vcl/qt5/QtAccessibleEventListener.cxx
@@ -213,12 +213,22 @@ void QtAccessibleEventListener::notifyEvent(const css::accessibility::Accessible
Reference<XAccessible> xChild;
if (aEvent.NewValue >>= xChild)
{
+ assert(xChild.is()
+ && "AccessibleEventId::CHILD event NewValue without valid child set");
+ // tdf#159213 for now, workaround invalid events being sent and don't crash in release builds
+ if (!xChild.is())
+ return;
QAccessible::updateAccessibility(new QAccessibleEvent(
QtAccessibleRegistry::getQObject(xChild), QAccessible::ObjectCreated));
return;
}
if (aEvent.OldValue >>= xChild)
{
+ assert(xChild.is()
+ && "AccessibleEventId::CHILD event OldValue without valid child set");
+ // tdf#159213 for now, workaround invalid events being sent and don't crash in release builds
+ if (!xChild.is())
+ return;
QAccessible::updateAccessibility(new QAccessibleEvent(
QtAccessibleRegistry::getQObject(xChild), QAccessible::ObjectDestroyed));
return;