When asking for relations, don't crash on children that don't return an interface.
Reviewed-by: Jan-Arve (cherry picked from commit a816cb0d26ebcef54e9e61c72455509edf6c44b9) Change-Id: I8fed57eb0dfd5b67dee440b19c0ad5b9d7b3ae2d Reviewed-on: http://codereview.qt.nokia.com/3020 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This commit is contained in:
parent
29a8761cd8
commit
a3ce0eb6f1
@ -704,12 +704,15 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||||||
int sibCount = pIface->childCount();
|
int sibCount = pIface->childCount();
|
||||||
QAccessibleInterface *candidate = 0;
|
QAccessibleInterface *candidate = 0;
|
||||||
for (int i = 0; i < sibCount && entry; ++i) {
|
for (int i = 0; i < sibCount && entry; ++i) {
|
||||||
pIface->navigate(Child, i+1, &candidate);
|
const int childId = pIface->navigate(Child, i+1, &candidate);
|
||||||
Q_ASSERT(candidate);
|
Q_ASSERT(childId >= 0);
|
||||||
if (candidate->relationTo(0, this, 0) & Label)
|
if (childId > 0)
|
||||||
|
candidate = pIface;
|
||||||
|
if (candidate->relationTo(childId, this, 0) & Label)
|
||||||
--entry;
|
--entry;
|
||||||
if (!entry)
|
if (!entry)
|
||||||
break;
|
break;
|
||||||
|
if (candidate != pIface)
|
||||||
delete candidate;
|
delete candidate;
|
||||||
candidate = 0;
|
candidate = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user