From b9a981e88f54d24b2a39e7e1801de8ab503daccf Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 7 Aug 2023 09:30:39 +0100 Subject: wina11y: Move and simplify casting for Get_ToATInterface Move the casting from AccObjectManagerAgent::Get_ToATInterface to AccObjectWinManager::Get_ToATInterface and just do a `reinterpret_cast(...)` right away instead of a `static_cast(reinterpret_cast(...))`. This is in preparation of dropping the AccObjectManagerAgent indirection altogether. Change-Id: Iad759f856f727418aab0d20b479fc38feac714ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155436 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- winaccessibility/inc/AccObjectWinManager.hxx | 2 +- winaccessibility/source/service/AccObjectManagerAgent.cxx | 3 +-- winaccessibility/source/service/AccObjectWinManager.cxx | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'winaccessibility') diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx index 55640fd8c6cb..b8f6c3bcd0f4 100644 --- a/winaccessibility/inc/AccObjectWinManager.hxx +++ b/winaccessibility/inc/AccObjectWinManager.hxx @@ -105,7 +105,7 @@ public: bool NotifyAccEvent(css::accessibility::XAccessible* pXAcc, UnoMSAAEvent eEvent); - LRESULT Get_ToATInterface(HWND hWnd, long lParam, WPARAM wParam); + sal_Int64 Get_ToATInterface(sal_Int64 nHWnd, long lParam, WPARAM wParam); void DecreaseState(css::accessibility::XAccessible* pXAcc, sal_Int64 nState); void IncreaseState(css::accessibility::XAccessible* pXAcc, sal_Int64 nState); diff --git a/winaccessibility/source/service/AccObjectManagerAgent.cxx b/winaccessibility/source/service/AccObjectManagerAgent.cxx index eb242c243183..9eb7f773d939 100644 --- a/winaccessibility/source/service/AccObjectManagerAgent.cxx +++ b/winaccessibility/source/service/AccObjectManagerAgent.cxx @@ -312,8 +312,7 @@ bool AccObjectManagerAgent::IsStateManageDescendant(XAccessible* pXAcc) sal_Int64 AccObjectManagerAgent::Get_ToATInterface( sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam) { - return static_cast(pWinManager->Get_ToATInterface( - static_cast(reinterpret_cast(hWnd)), lParam, wParam)); + return pWinManager->Get_ToATInterface(hWnd, lParam, wParam); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index dfc74f7bd4ef..9299c9a61887 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -91,13 +91,14 @@ AccObjectWinManager::~AccObjectWinManager() * @return Com interface with event. */ -LRESULT -AccObjectWinManager::Get_ToATInterface(HWND hWnd, long lParam, WPARAM wParam) +sal_Int64 +AccObjectWinManager::Get_ToATInterface(sal_Int64 nHWnd, long lParam, WPARAM wParam) { IMAccessible* pRetIMAcc = nullptr; if(lParam == OBJID_CLIENT ) { + HWND hWnd = reinterpret_cast(nHWnd); pRetIMAcc = GetTopWindowIMAccessible(hWnd); } @@ -105,7 +106,7 @@ AccObjectWinManager::Get_ToATInterface(HWND hWnd, long lParam, WPARAM wParam) { LRESULT result = LresultFromObject(IID_IAccessible, wParam, pRetIMAcc); pRetIMAcc->Release(); - return result; + return static_cast(result); } return 0; } -- cgit