winaccessibility/source/UAccCOM/MAccessible.cxx | 121 ------------------------ winaccessibility/source/UAccCOM/MAccessible.h | 9 - 2 files changed, 130 deletions(-)
New commits: commit 7dbbf8eba4a8131efe224b17a613cd09c4042dd4 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Sep 16 11:17:48 2022 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Sep 16 17:56:40 2022 +0200 wina11y: Drop unused CMAccessible helper methods Their doc says that they are for the `accSelect` implementation, but that one doesn't actually make use of them. Change-Id: I9185a905d00484fcb950a1bdb6013e07a089bb22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140069 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 3cb544f3ba80..a1b24aa0d62e 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -2068,127 +2068,6 @@ XAccessibleContext* CMAccessible::GetContextByXAcc( XAccessible* pXAcc ) return pRContext.get(); } -/** -* Return the member variable m_pXAccessibleSelection, instead of -* get XAccessibleSelection according to XAccessibleContext because if so,it will -* depend on the UNO implementation code,so when COM is created, put XAccessibleSelection -* by bridge management system -* @return XAccessibleSelection*, the selection of the current object. -*/ -Reference< XAccessibleSelection > CMAccessible::GetSelection() -{ - if (!m_xAccessible.is()) - return nullptr; - Reference<XAccessibleContext> const pRContext = - m_xAccessible->getAccessibleContext(); - if(pRContext.is()) - { - Reference< XAccessibleSelection > pRSelection(pRContext,UNO_QUERY); - return pRSelection; - } - return nullptr; -} - -/** -* Select one XAccessible item, for accSelect implementation -* @param pItem, the item should be selected. -* @return S_OK if successful. -*/ -HRESULT CMAccessible::SelectChild(XAccessible* pItem) -{ - - try { - if (m_isDestroy) return S_FALSE; - XAccessibleContext* pParentContext = GetContextByXAcc(m_xAccessible.get()); - XAccessibleContext* pContext = GetContextByXAcc( pItem ); - if( pParentContext == nullptr || pContext == nullptr ) - return E_FAIL; - - Reference< XAccessibleSelection > pRSelection = GetSelection(); - if( !pRSelection.is() ) - return E_FAIL; - pRSelection->selectAccessibleChild(pContext->getAccessibleIndexInParent()); - return S_OK; - - } catch(...) { return E_FAIL; } -} - -/** -* Deselect one XAccessible item, for accSelect implementation -* @param pItem, the item should be deselected. -* @return S_OK if successful. -*/ -HRESULT CMAccessible::DeSelectChild(XAccessible* pItem) -{ - - try { - if (m_isDestroy) return S_FALSE; - XAccessibleContext* pParentContext = GetContextByXAcc(m_xAccessible.get()); - ; - XAccessibleContext* pContext = GetContextByXAcc( pItem ); - if( pParentContext == nullptr || pContext == nullptr ) - return E_INVALIDARG; - - Reference< XAccessibleSelection > pRSelection = GetSelection(); - if( !pRSelection.is() ) - return E_FAIL; - pRSelection->deselectAccessibleChild(pContext->getAccessibleIndexInParent()); - - return S_OK; - - } catch(...) { return E_FAIL; } -} - -/** -* Select multiple XAccessible items,for implementation of accSelect -* @param pItem, the items should be selected. -* @param size, the size of the items. -* @return S_OK if successful. -*/ -HRESULT CMAccessible::SelectMultipleChidren( XAccessible** pItem,int size ) -{ - - try { - if (m_isDestroy) return S_FALSE; - // #CHECK# - if(pItem == nullptr) - { - return E_INVALIDARG; - } - for(int index = 0;index < size;index++) - { - SelectChild( pItem[index] ); - } - return S_OK; - - } catch(...) { return E_FAIL; } -} - -/** -* Deselect multiple XAccessible items,for implementation of accSelect -* @param pItem, the items should be selected. -* @param size, the size of the items. -* @return S_OK if successful. -*/ -HRESULT CMAccessible::DeSelectMultipleChildren( XAccessible** pItem,int size ) -{ - - try { - if (m_isDestroy) return S_FALSE; - // #CHECK# - if(pItem == nullptr) - { - return E_INVALIDARG; - } - for(int index = 0;index < size;index++) - { - DeSelectChild( pItem[index] ); - } - return S_OK; - - } catch(...) { return E_FAIL; } -} - /** * When COM is created, UNO set XAccessible pointer to it * in order to COM can operate UNO information diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h index 8a239fd16340..baa13b45f2b1 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.h +++ b/winaccessibility/source/UAccCOM/MAccessible.h @@ -192,17 +192,8 @@ private: HRESULT GetNextSibling(VARIANT varStart,VARIANT* pvarEndUpAt);//for accNavigate implementation HRESULT GetPreSibling(VARIANT varStart,VARIANT* pvarEndUpAt);//for accNavigate implementation - // the following private methods are used to implement accSelect method - HRESULT SelectChild(css::accessibility::XAccessible* pItem); - HRESULT DeSelectChild(css::accessibility::XAccessible* pItem); - HRESULT SelectMultipleChidren(css::accessibility::XAccessible** pItem, - int size); - HRESULT DeSelectMultipleChildren(css::accessibility::XAccessible** pItem, - int size); static css::accessibility::XAccessibleContext* GetContextByXAcc( css::accessibility::XAccessible* pXAcc); - css::uno::Reference<css::accessibility::XAccessibleSelection> GetSelection(); - // end accSelect implementation methods static bool GetXInterfaceFromXAccessible(css::accessibility::XAccessible*, css::uno::XInterface**, XInterfaceType); HRESULT WINAPI SmartQI(void* pv, REFIID iid, void** ppvObject);