diff options
Diffstat (limited to 'src/plugins/platforms/windows')
3 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp index fb08daa38e..44e715d0ce 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp +++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp @@ -645,7 +645,8 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_locationInParent(long *x, l QPoint topLeft = accessible->rect().topLeft(); - if (QAccessibleInterface *parentIface = accessible->parent()) + QAccessibleInterface *parentIface = accessible->parent(); + if (parentIface && parentIface->isValid()) topLeft -= parentIface->rect().topLeft(); *x = topLeft.x(); @@ -1596,7 +1597,7 @@ uint QWindowsIA2Accessible::uniqueID() const if (!uid) { QAccessibleInterface *acc = accessible; QVector<int> indexOfNodes; - while (acc && !acc->object()) { + while (acc && acc->isValid() && !acc->object()) { QAccessibleInterface *par = acc->parent(); indexOfNodes.append(par->indexOfChild(acc)); if (acc != accessible) diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp index 146b114389..79d0934ebb 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp @@ -215,7 +215,7 @@ QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface) QWindow *window = iface->window(); if (!window) { QAccessibleInterface *acc = iface->parent(); - while (acc && !window) { + while (acc && acc->isValid() && !window) { window = acc->window(); QAccessibleInterface *par = acc->parent(); delete acc; diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp index bb5d5d13a7..9958615d45 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp @@ -612,7 +612,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accNavigate(long navDir, VARIA case NAVDIR_PREVIOUS: if (!varStart.lVal){ QAccessibleInterface *parent = accessible->parent(); - if (parent) { + if (parent && parent->isValid()) { int index = parent->indexOfChild(accessible); index += (navDir == NAVDIR_NEXT) ? 1 : -1; if (index >= 0 && index < parent->childCount()) @@ -631,8 +631,9 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accNavigate(long navDir, VARIA case NAVDIR_UP: case NAVDIR_DOWN: case NAVDIR_LEFT: - case NAVDIR_RIGHT: - if (QAccessibleInterface *pIface = accessible->parent()) { + case NAVDIR_RIGHT: { + QAccessibleInterface *pIface = accessible->parent(); + if (pIface && pIface->isValid()) { const int indexOfOurself = pIface->indexOfChild(accessible); QRect startg = accessible->rect(); QPoint startc = startg.center(); @@ -709,6 +710,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accNavigate(long navDir, VARIA delete pIface; acc = candidate; } + } break; default: break; |