winaccessibility/inc/AccObject.hxx                      |    4 +---
 winaccessibility/source/UAccCOM/MAccessible.cxx         |    7 +++----
 winaccessibility/source/UAccCOM/MAccessible.h           |    2 +-
 winaccessibility/source/UAccCOMIDL/UAccCOM.idl          |    2 +-
 winaccessibility/source/service/AccObject.cxx           |   10 ++--------
 winaccessibility/source/service/AccObjectWinManager.cxx |    2 +-
 6 files changed, 9 insertions(+), 18 deletions(-)

New commits:
commit 85b4b15bb02f8d2fdbead0c836763621096b995e
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Sep 20 09:23:10 2021 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Sep 20 18:05:00 2021 +0200

    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 <m.wegh...@posteo.de>

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();
     }
 }
 
commit 185b183a71924c84edb385ec5eb4fe6d4bfe8e05
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Sep 20 08:40:05 2021 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Sep 20 18:04:49 2021 +0200

    wina11y: Drop AccObject::m_bShouldDestroy
    
    The getter, 'AccObject::ifShouldDestroy',
    was unused, so drop it.
    
    The only place where the 'm_bShouldDestroy' member
    was actually used was in 'AccObject::NotifyDestroy',
    where it was assigned a value from a method param that
    was then passed further right away, so there's no need to
    store the value at all.
    
    Change-Id: Id5688e9742892e345b143a8eebeed5099696a0f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122342
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/inc/AccObject.hxx 
b/winaccessibility/inc/AccObject.hxx
index 2b2232323a02..bc689178c95c 100644
--- a/winaccessibility/inc/AccObject.hxx
+++ b/winaccessibility/inc/AccObject.hxx
@@ -59,7 +59,6 @@ private:
     short               m_accRole;
     long                m_resID;
     HWND                m_pParantID;
-    bool                m_bShouldDestroy; //avoid access COM interface when 
acc object is deleted
     IMAccessible*       m_pIMAcc;
     AccObject*          m_pParentObj;
     IAccChildList       m_childrenList;
@@ -108,8 +107,7 @@ public:
     void DeleteChild( AccObject* pChild );
     AccObject* NextChild();
 
-    void NotifyDestroy(bool ifDelete);
-    bool ifShouldDestroy();
+    void NotifyDestroy(bool bDestroy);
 
     void  DecreaseState(short xState );//call COM interface DecreaseState 
method
     void  IncreaseState( short xState );//call COM interface IncreaseState 
method
diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 9e3f7d063b3b..7d1adb27afd4 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -162,7 +162,6 @@ AccObject::AccObject(XAccessible* pAcc, 
AccObjectManagerAgent* pAgent,
                      AccEventListener* pListener) :
         m_resID     (NULL),
         m_pParantID (nullptr),
-        m_bShouldDestroy(false),
         m_pIMAcc    (nullptr),
         m_pParentObj(nullptr),
         m_pListener (pListener),
@@ -1117,11 +1116,10 @@ void AccObject::GetExpandedState( sal_Bool* 
isExpandable, sal_Bool* isExpanded)
     }
 }
 
-void AccObject::NotifyDestroy(bool ifDelete)
+void AccObject::NotifyDestroy(bool bDestroy)
 {
-    m_bShouldDestroy=ifDelete;
     if(m_pIMAcc)
-        m_pIMAcc->NotifyDestroy(m_bShouldDestroy);
+        m_pIMAcc->NotifyDestroy(bDestroy);
 }
 
 void AccObject::SetParentObj(AccObject* pParentAccObj)
@@ -1187,9 +1185,5 @@ AccObject* AccObject::GetParentObj()
 {
     return m_pParentObj;
 }
-bool  AccObject::ifShouldDestroy()
-{
-    return m_bShouldDestroy;
-}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to