summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2012-10-18 16:24:37 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-27 20:21:56 +0200
commit31b4507cf46a4be8b15e52973cf132a51bf85870 (patch)
tree0d86bbcc5e45b901f7456992251e6b1b123ba463
parent8a0602873e4a224cdd3d835f3ab1b08dcc2ef246 (diff)
Be more careful about asserting in accessibility.
It is possible to call the accessibility update for any widget, even if it doesn't implement the right interfaces. While that is bad, warning about it is better than asserting. Change-Id: I23c0c783083f73fb816d75b2c9b78efd603edcb6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index f69e2365d8..79d732504a 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -1023,7 +1023,11 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::TextCaretMoved: {
if (sendObject || sendObject_text_caret_moved) {
QAIPointer iface = QAIPointer(event->accessibleInterface());
- Q_ASSERT(iface->textInterface());
+ if (!iface->textInterface()) {
+ qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface << iface->object();
+ return;
+ }
+
QString path = pathForInterface(iface);
QDBusVariant cursorData;
int pos = iface->textInterface()->cursorPosition();