winaccessibility/inc/AccObject.hxx                      |    4 
 winaccessibility/inc/AccObjectWinManager.hxx            |    1 
 winaccessibility/source/service/AccObject.cxx           |   15 ---
 winaccessibility/source/service/AccObjectWinManager.cxx |   79 ----------------
 4 files changed, 99 deletions(-)

New commits:
commit 7d873ed7043c4f7d671d443bcf92369b5fe37224
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Aug 31 16:06:20 2022 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Aug 31 23:38:11 2022 +0200

    wina11y: Drop unused member and methods related to selection
    
    Those were only used by
    `AccObjectWinManager::UpdateAccSelection`,
    which has been dropped in
    Change-Id I49bfddb636721d9142a88b7ce1eb3ee3a2f9c695
    ("wina11y: Drop unused AccObjectWinManager::UpdateAccSelection").
    
    Change-Id: I11d1ad3f01929a68e341f910ec6382f91227e3c4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139124
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/inc/AccObject.hxx 
b/winaccessibility/inc/AccObject.hxx
index 0b34f076b5d6..707d307242bc 100644
--- a/winaccessibility/inc/AccObject.hxx
+++ b/winaccessibility/inc/AccObject.hxx
@@ -48,7 +48,6 @@ class AccEventListener;
 class AccObjectManagerAgent;
 class AccObject;
 
-typedef std::map<const long, AccObject*> IAccSelectionList;
 typedef std::vector<AccObject *> IAccChildList;
 
 
@@ -63,7 +62,6 @@ private:
     AccObject*          m_pParentObj;
     IAccChildList       m_childrenList;
     ::rtl::Reference<AccEventListener>  m_pListener;
-    IAccSelectionList   m_selectionList;
 
     css::uno::Reference < css::accessibility::XAccessible > m_xAccRef;
     css::uno::Reference < css::accessibility::XAccessibleAction > 
m_xAccActionRef;
@@ -126,8 +124,6 @@ public:
     void  setFocus();
     void  unsetFocus();
 
-    void  AddSelect(long index, AccObject* accObj);
-    IAccSelectionList& GetSelection();
     void  setLocalizedResourceString();
 };
 
diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 7b3f1e6fc1db..1f7dc5df224d 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -953,21 +953,6 @@ bool AccObject::UpdateAccessibleInfoFromUnoToMSAA()
     return true;
 }
 
-/*
-   * Add a child selected element.
-   * @param pAccObj Child object pointer.
-   * @return
-   */
-void AccObject::AddSelect( long index, AccObject* accObj)
-{
-    m_selectionList.emplace(index,accObj);
-}
-
-IAccSelectionList& AccObject::GetSelection()
-{
-    return m_selectionList;
-}
-
 
 /**
    * Set self to focus object in parent child list
commit 58649c1db48b888f7ce4946ca92895fa0bc63349
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Aug 31 15:50:36 2022 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Aug 31 23:37:56 2022 +0200

    wina11y: Drop unused AccObjectWinManager::UpdateAccSelection
    
    It was already unused when it was added in
    
        commit a18bdb3bc05e761704cc345a66a9d642bc4f4a0a
        Date:   Thu Nov 14 08:18:05 2013 +0000
    
            Integrate branch of IAccessible2
    
    `CMAccessible::get_accSelection` already queries
    information on demand.
    
    The dropped method looks like another one of the methods that
    could be used for manual bookkeeping of information
    instead of querying them from the underlying UNO
    interfaces on demand. But retrieving them on demand
    seems preferable, s.a. the commit message in
    
        commit fcf4a26275d7503835f9aa23cb94938809840300
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Wed Jan 5 13:41:53 2022 +0000
        tdf#146306 wina11y: Retrieve accessible desc on demand
    
    > Querying up-to-date values from the underlying
    > UNO interfaces on demand instead of doing extra
    > manual bookkeeping in the winaccessibility code
    > may be possible for more a11y attributes in addition
    > to the accessible description handled in this commit,
    > but each one will have to be looked at separately.
    
    Change-Id: I49bfddb636721d9142a88b7ce1eb3ee3a2f9c695
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139123
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/inc/AccObjectWinManager.hxx 
b/winaccessibility/inc/AccObjectWinManager.hxx
index f1adfb0dc9d0..6ca9319f82a0 100644
--- a/winaccessibility/inc/AccObjectWinManager.hxx
+++ b/winaccessibility/inc/AccObjectWinManager.hxx
@@ -96,7 +96,6 @@ private:
     static void InsertAccChildNode(AccObject* pCurObj,AccObject* 
pParentObj,HWND pWnd);
     static void DeleteAccChildNode(AccObject* pChild);
     void       DeleteFromHwndXAcc(css::accessibility::XAccessible const * 
pXAcc );
-    int  UpdateAccSelection(css::accessibility::XAccessible* pXAcc);
 
     ::rtl::Reference<AccEventListener> CreateAccEventListener(
             css::accessibility::XAccessible* pXAcc);
diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx 
b/winaccessibility/source/service/AccObjectWinManager.cxx
index 8349d5c863cd..c404223fb73a 100644
--- a/winaccessibility/source/service/AccObjectWinManager.cxx
+++ b/winaccessibility/source/service/AccObjectWinManager.cxx
@@ -367,85 +367,6 @@ void AccObjectWinManager::UpdateAccFocus(XAccessible* 
newFocus)
     }
 }
 
-/**
-   * Update selected object by new focused XAccessible interface.
-   * @param pXAcc XAccessible interface that has selected child changed.
-   * @return Selected children count.
-   */
-int AccObjectWinManager::UpdateAccSelection(XAccessible* pXAcc)
-{
-    Reference< XAccessibleContext > pRContext;
-
-    if( pXAcc == nullptr)
-        return 0;
-
-    pRContext = pXAcc->getAccessibleContext();
-    if( !pRContext.is() )
-        return 0;
-
-    Reference< XAccessibleSelection > pRSelection(pRContext,UNO_QUERY);
-    if( !pRSelection.is() )
-        return 0;
-
-    AccObject* pAccObj = GetAccObjByXAcc(pXAcc);
-    if(pAccObj==nullptr)
-        return 0;
-
-    Reference<XAccessible> pRChild;
-    AccObject* pAccChildObj = nullptr;
-    int selectNum= pRSelection->getSelectedAccessibleChildCount();
-
-    IAccSelectionList oldSelection = pAccObj->GetSelection();
-
-    if(selectNum > 4)//for selected.
-        return selectNum;
-    if(selectNum == 1 && oldSelection.size() == 0)
-        return 1;
-
-    for (int i=0;i<selectNum;i++)
-    {
-        pRChild = pRSelection->getSelectedAccessibleChild(i);
-        if(!pRChild.is())
-        {
-            continue;
-        }
-        Reference<XAccessibleContext> pRChildContext = 
pRChild->getAccessibleContext();
-        if(!pRChildContext.is())
-        {
-            continue;
-        }
-        long index = pRChildContext->getAccessibleIndexInParent();
-        IAccSelectionList::iterator temp = oldSelection.find(index);
-        if ( temp != oldSelection.end() )
-        {
-            oldSelection.erase(index);
-            continue;
-        }
-
-        pAccChildObj = GetAccObjByXAcc(pRChild.get());
-        if(!pAccChildObj)
-        {
-            InsertAccObj(pRChild.get(), pXAcc,pAccObj->GetParentHWND());
-            pAccChildObj = GetAccObjByXAcc(pRChild.get());
-        }
-
-        pAccObj->AddSelect(index, pAccChildObj);
-
-        if(pAccChildObj != nullptr)
-            NotifyWinEvent(EVENT_OBJECT_SELECTIONADD,pAccObj->GetParentHWND(), 
OBJID_CLIENT,pAccChildObj->GetResID());
-    }
-
-    for (const auto& rEntry : oldSelection)
-    {
-        pAccObj->GetSelection().erase(rEntry.first);
-        pAccChildObj = rEntry.second;
-        if(pAccChildObj != nullptr)
-            
NotifyWinEvent(EVENT_OBJECT_SELECTIONREMOVE,pAccObj->GetParentHWND(), 
OBJID_CLIENT,pAccChildObj->GetResID());
-    }
-    return 0;
-
-}
-
 /**
    * Delete child element from children list.
    * @param pObj Child element that should be removed from parent child list.

Reply via email to