From 85b4b15bb02f8d2fdbead0c836763621096b995e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 20 Sep 2021 09:23:10 +0100 Subject: wina11y: Drop bool param from CMAccessible::NotifyDestroy ... and 'AccObject::NotifyDestroy', respectively. The only calling site calls it with 'true' as parameter (and 'CMAccessible::NotifyDestroy' was calling 'm_xAccessible.clear()' regardless of what value the passed param had anyway). Change-Id: I08a24f79b50ec327ae461bd44ee6460a2d8145f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122343 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- winaccessibility/inc/AccObject.hxx | 2 +- winaccessibility/source/UAccCOM/MAccessible.cxx | 7 +++---- winaccessibility/source/UAccCOM/MAccessible.h | 2 +- winaccessibility/source/UAccCOMIDL/UAccCOM.idl | 2 +- winaccessibility/source/service/AccObject.cxx | 4 ++-- winaccessibility/source/service/AccObjectWinManager.cxx | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/winaccessibility/inc/AccObject.hxx b/winaccessibility/inc/AccObject.hxx index bc689178c95c..2a246ce43b29 100644 --- a/winaccessibility/inc/AccObject.hxx +++ b/winaccessibility/inc/AccObject.hxx @@ -107,7 +107,7 @@ public: void DeleteChild( AccObject* pChild ); AccObject* NextChild(); - void NotifyDestroy(bool bDestroy); + void NotifyDestroy(); void DecreaseState(short xState );//call COM interface DecreaseState method void IncreaseState( short xState );//call COM interface IncreaseState method diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 2d62ec494bc7..8f69dcf01649 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -1364,15 +1364,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccAgent(hyper pAgent) /** * When a UNO control disposing, it disposes its listeners, * then notify AccObject in bridge management, then notify -* COM that the XAccessible is invalid,so set m_xAccessible as NULL -* @param isDestroy, true is it needs to be destroyed. +* COM that the XAccessible is invalid, so set m_xAccessible as NULL * @return S_OK if successful and E_FAIL if failure. */ -COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::NotifyDestroy(BOOL isDestroy) +COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::NotifyDestroy() { // internal IMAccessible - no mutex meeded - m_isDestroy = isDestroy; + m_isDestroy = true; m_xAccessible.clear(); return S_OK; } diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h index 71296cfc2fda..224e59179d61 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.h +++ b/winaccessibility/source/UAccCOM/MAccessible.h @@ -147,7 +147,7 @@ public: STDMETHOD(Put_XAccWindowHandle)(HWND hwnd) override; STDMETHOD(Put_XAccChildID)(long dChildID) override; STDMETHOD(Put_XAccAgent)(hyper pAgent) override; - STDMETHOD(NotifyDestroy)(BOOL isDestroy) override; + STDMETHOD(NotifyDestroy)() override; STDMETHOD(Put_ActionDescription)( const OLECHAR* szAction) override; STDMETHOD(SetDefaultAction)(hyper pAction) override; STDMETHOD(GetUNOInterface)(hyper*) override; diff --git a/winaccessibility/source/UAccCOMIDL/UAccCOM.idl b/winaccessibility/source/UAccCOMIDL/UAccCOM.idl index 1a0705754114..da123ab7f972 100644 --- a/winaccessibility/source/UAccCOMIDL/UAccCOM.idl +++ b/winaccessibility/source/UAccCOMIDL/UAccCOM.idl @@ -49,7 +49,7 @@ import "defines.idl"; [id(23), helpstring("method SetDefaultAction")] HRESULT SetDefaultAction(hyper pAction); [id(24), helpstring("method Put_ActionDescription")] HRESULT Put_ActionDescription( const OLECHAR* szAction); [id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(hyper pAgent); - [id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy(BOOL isDestroy); + [id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy(); [id(30), helpstring("method Get_XAccChildID")] HRESULT Get_XAccChildID([out,retval] long* childID); }; [ diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx index 7d1adb27afd4..877d33cc0e37 100644 --- a/winaccessibility/source/service/AccObject.cxx +++ b/winaccessibility/source/service/AccObject.cxx @@ -1116,10 +1116,10 @@ void AccObject::GetExpandedState( sal_Bool* isExpandable, sal_Bool* isExpanded) } } -void AccObject::NotifyDestroy(bool bDestroy) +void AccObject::NotifyDestroy() { if(m_pIMAcc) - m_pIMAcc->NotifyDestroy(bDestroy); + m_pIMAcc->NotifyDestroy(); } void AccObject::SetParentObj(AccObject* pParentAccObj) diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index 39f9f4a621f9..89d3e7db5d5e 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -1154,7 +1154,7 @@ void AccObjectWinManager::NotifyDestroy(XAccessible* pXAcc) AccObject* accObj = GetAccObjByXAcc(pXAcc); if(accObj) { - accObj->NotifyDestroy(true); + accObj->NotifyDestroy(); } } -- cgit