Windows Accessibility: Use QWindowsAccessibility::windowHelper().

Amends changes ee51638187,
d7a3b61459.

Task-number: QTBUG-52943
Change-Id: Icdf9d99c327bdd38dfb084e6cf77b14cd5ce073b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2016-05-09 09:45:49 +02:00
parent 0453897f1e
commit c0425f39d1

View File

@ -470,15 +470,6 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::Invoke(long dispIdMember,
return hr;
}
static const QWindow *windowOf(const QAccessibleInterface *ai)
{
for ( ; ai; ai = ai->parent()) {
if (const QWindow *window = ai->window())
return window;
}
return Q_NULLPTR;
}
/*
IAccessible
@ -507,7 +498,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accHitTest(long xLeft, long yT
if (!accessible)
return E_FAIL;
const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop), windowOf(accessible));
const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop),
QWindowsAccessibility::windowHelper(accessible));
QAccessibleInterface *child = accessible->childAt(pos.x(), pos.y());
if (child == 0) {
// no child found, return this item if it contains the coordinates
@ -550,7 +542,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accLocation(long *pxLeft, long
QAccessibleInterface *acc = childPointer(accessible, varID);
if (!acc || !acc->isValid())
return E_FAIL;
const QRect rect = QHighDpi::toNativePixels(acc->rect(), windowOf(accessible));
const QRect rect = QHighDpi::toNativePixels(acc->rect(),
QWindowsAccessibility::windowHelper(accessible));
*pxLeft = rect.x();
*pyTop = rect.y();