winaccessibility/inc/AccObjectWinManager.hxx | 2 -- winaccessibility/source/service/AccObjectWinManager.cxx | 15 +-------------- 2 files changed, 1 insertion(+), 16 deletions(-)
New commits: commit 0c7a5e6f419a679afef35cb8b3f203eae9e6231c Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 21 09:26:10 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Aug 21 18:49:20 2024 +0200 wina11y: Drop AccObjectWinManager::GetRole For the only in `AccObjectWinManager::InsertAccObj`, there's already a reference to the `XAccessibleContext`, so just call `XAccessibleContext::getAccessibleRole` directly. Change-Id: I9e0a96d67ac8550b4988de6c3cefc8d6e0b319ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172181 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx index a910fc71341b..9a6b9f0fe243 100644 --- a/winaccessibility/inc/AccObjectWinManager.hxx +++ b/winaccessibility/inc/AccObjectWinManager.hxx @@ -129,8 +129,6 @@ public: void UpdateChildState(css::accessibility::XAccessible* pXAcc); - static short GetRole(css::accessibility::XAccessible* pXAcc); - css::accessibility::XAccessible* GetAccDocByAccTopWin( css::accessibility::XAccessible* pXAcc ); bool IsTopWinAcc( css::accessibility::XAccessible* pXAcc ); diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index f3a8ba9d2068..bf3c63825903 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -589,7 +589,7 @@ bool AccObjectWinManager::InsertAccObj( XAccessible* pXAcc,XAccessible* pParentX return false; { - short nCurRole = GetRole(pXAcc); + short nCurRole = pRContext->getAccessibleRole(); std::scoped_lock l(m_Mutex); @@ -1034,17 +1034,6 @@ void AccObjectWinManager::UpdateChildState(css::accessibility::XAccessible* pAcc } } -short AccObjectWinManager::GetRole(css::accessibility::XAccessible* pXAcc) -{ - assert(pXAcc != nullptr); - Reference<css::accessibility::XAccessibleContext> xContext = pXAcc->getAccessibleContext(); - if(xContext.is()) - { - return xContext->getAccessibleRole(); - } - return -1; -} - XAccessible* AccObjectWinManager::GetAccDocByHWND(HWND pWnd) { XHWNDToDocumentHash::iterator aIter; commit 2eb96649c9430256e37fc64fd731831d556894ea Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 21 09:16:45 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Aug 21 18:49:13 2024 +0200 wina11y: Drop extra check in AccObjectWinManager::InsertAccObj The `AccObject` ctor asserts that `AccObject::m_pIMAcc` is non-null, so there's no need to check here again. Change-Id: Ieb80dfa4f7229b63dbf53ed77ae54f8d4b1f5211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172180 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index 8d62ace211cd..f3a8ba9d2068 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -628,8 +628,6 @@ bool AccObjectWinManager::InsertAccObj( XAccessible* pXAcc,XAccessible* pParentX } AccObject pObj(pXAcc, this); - if( pObj.GetIMAccessible() == nullptr ) - return false; pObj.SetResID( this->ImpleGenerateResID()); pObj.SetParentHWND( pWnd );