diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2012-09-22 18:37:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-27 23:51:30 +0200 |
commit | e8ca2e008f52a818884b151dd93226813832ef94 (patch) | |
tree | 35af5e234d2373c080bfb464c585f5df68bb7f28 /src/platformsupport/linuxaccessibility | |
parent | 0a7e8350ae0a461d90619382c61e933eb0494be9 (diff) |
Accessibility: rather than assert, just warn.
Screen readers do random things with the dbus interface,
we should be careful when handling what they send.
Change-Id: Ie8fc515c8d399dae9b5e892a135b54a1820d09e2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/platformsupport/linuxaccessibility')
-rw-r--r-- | src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index d4462c88f2..2d6a103fec 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -2144,11 +2144,13 @@ bool AtSpiAdaptor::tableInterface(const QAIPointer &interface, const QString &fu } else if (function == QLatin1String("GetAccessibleAt")) { int row = message.arguments().at(0).toInt(); int column = message.arguments().at(1).toInt(); - Q_ASSERT(interface->tableInterface()); - Q_ASSERT(row >= 0); - Q_ASSERT(column >= 0); - Q_ASSERT(row < interface->tableInterface()->rowCount()); - Q_ASSERT(column < interface->tableInterface()->columnCount()); + if ((row < 0) || + (column < 0) || + (row >= interface->tableInterface()->rowCount()) || + (column >= interface->tableInterface()->columnCount())) { + qWarning() << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ")"; + return false; + } QSpiObjectReference ref; QAIPointer cell(interface->tableInterface()->cellAt(row, column)); |