Kaydet (Commit) 58ab5239 authored tarafından Michael Stahl's avatar Michael Stahl

winaccessibility: CMAccessible needs only one XAccessibleContext

Merge aliases pRContextInterface (unused) and pRContext; this is
exacerbated by countless local variables pRContext that shadow the
member...

Change-Id: I6bc71911fb41a2ce2590d614020ecea36d6ab4f8
üst fd2877ee
...@@ -248,7 +248,6 @@ CMAccessible::~CMAccessible() ...@@ -248,7 +248,6 @@ CMAccessible::~CMAccessible()
} }
m_pEnumVar->Release(); m_pEnumVar->Release();
m_containedObjects.clear(); m_containedObjects.clear();
pRContext = NULL;
} }
/** /**
...@@ -1667,9 +1666,10 @@ STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations) ...@@ -1667,9 +1666,10 @@ STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations)
*nRelations = 0; *nRelations = 0;
if( !pRContext.is() ) if (!m_xContext.is())
return E_FAIL; return E_FAIL;
Reference<XAccessibleRelationSet> pRrelationSet = pRContext.get()->getAccessibleRelationSet(); Reference<XAccessibleRelationSet> pRrelationSet =
m_xContext.get()->getAccessibleRelationSet();
if(!pRrelationSet.is()) if(!pRrelationSet.is())
{ {
*nRelations = 0; *nRelations = 0;
...@@ -1694,7 +1694,7 @@ STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation ...@@ -1694,7 +1694,7 @@ STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation
return E_INVALIDARG; return E_INVALIDARG;
} }
if( !pRContext.is() ) if (!m_xContext.is())
return E_FAIL; return E_FAIL;
...@@ -1712,9 +1712,8 @@ STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation ...@@ -1712,9 +1712,8 @@ STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation
if( relationIndex < nMax ) if( relationIndex < nMax )
{ {
Reference<XAccessibleRelationSet> const pRrelationSet =
m_xContext.get()->getAccessibleRelationSet();
Reference<XAccessibleRelationSet> pRrelationSet = pRContext.get()->getAccessibleRelationSet();
if(!pRrelationSet.is()) if(!pRrelationSet.is())
{ {
...@@ -1762,10 +1761,11 @@ STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *_ ...@@ -1762,10 +1761,11 @@ STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *_
} }
// #CHECK XInterface# // #CHECK XInterface#
if( !pRContext.is() ) if (!m_xContext.is())
return E_FAIL; return E_FAIL;
Reference<XAccessibleRelationSet> pRrelationSet = pRContext.get()->getAccessibleRelationSet(); Reference<XAccessibleRelationSet> const pRrelationSet =
m_xContext.get()->getAccessibleRelationSet();
if(!pRrelationSet.is()) if(!pRrelationSet.is())
{ {
*nRelations = 0; *nRelations = 0;
...@@ -2284,8 +2284,7 @@ STDMETHODIMP CMAccessible::SetXAccessible(hyper pXAcc) ...@@ -2284,8 +2284,7 @@ STDMETHODIMP CMAccessible::SetXAccessible(hyper pXAcc)
m_pEnumVar->PutSelection(/*XAccessibleSelection*/ m_pEnumVar->PutSelection(/*XAccessibleSelection*/
reinterpret_cast<hyper>(m_xAccessible.get())); reinterpret_cast<hyper>(m_xAccessible.get()));
pRContext = m_xAccessible->getAccessibleContext(); m_xContext = m_xAccessible->getAccessibleContext();
pRContextInterface = (XAccessibleContext*)pRContext.is();
return S_OK; return S_OK;
} }
...@@ -3030,11 +3029,12 @@ STDMETHODIMP CMAccessible:: get_states(AccessibleStates __RPC_FAR *states ) ...@@ -3030,11 +3029,12 @@ STDMETHODIMP CMAccessible:: get_states(AccessibleStates __RPC_FAR *states )
CHECK_ENABLE_INF CHECK_ENABLE_INF
ENTER_PROTECTED_BLOCK ENTER_PROTECTED_BLOCK
ISDESTROY() ISDESTROY()
// #CHECK XInterface#
if( !pRContext.is() )
return E_FAIL;
Reference<XAccessibleStateSet> pRStateSet = pRContext.get()->getAccessibleStateSet(); if (!m_xContext.is())
return E_FAIL;
Reference<XAccessibleStateSet> const pRStateSet =
m_xContext.get()->getAccessibleStateSet();
if(!pRStateSet.is()) if(!pRStateSet.is())
{ {
return S_OK; return S_OK;
...@@ -3117,11 +3117,10 @@ STDMETHODIMP CMAccessible:: get_indexInParent( long __RPC_FAR *accParentIndex) ...@@ -3117,11 +3117,10 @@ STDMETHODIMP CMAccessible:: get_indexInParent( long __RPC_FAR *accParentIndex)
if(accParentIndex == NULL) if(accParentIndex == NULL)
return E_INVALIDARG; return E_INVALIDARG;
// #CHECK XInterface# if (!m_xContext.is())
if( !pRContext.is() )
return E_FAIL; return E_FAIL;
*accParentIndex = pRContext.get()->getAccessibleIndexInParent(); *accParentIndex = m_xContext.get()->getAccessibleIndexInParent();
return S_OK; return S_OK;
...@@ -3135,12 +3134,11 @@ STDMETHODIMP CMAccessible:: get_locale( IA2Locale __RPC_FAR *locale ) ...@@ -3135,12 +3134,11 @@ STDMETHODIMP CMAccessible:: get_locale( IA2Locale __RPC_FAR *locale )
ISDESTROY() ISDESTROY()
if(locale == NULL) if(locale == NULL)
return E_INVALIDARG; return E_INVALIDARG;
// #CHECK XInterface#
if( !pRContext.is() ) if (!m_xContext.is())
return E_FAIL; return E_FAIL;
::com::sun::star::lang::Locale unoLoc = pRContext.get()->getLocale(); ::com::sun::star::lang::Locale unoLoc = m_xContext.get()->getLocale();
locale->language = SysAllocString((OLECHAR*)unoLoc.Language.getStr()); locale->language = SysAllocString((OLECHAR*)unoLoc.Language.getStr());
locale->country = SysAllocString((OLECHAR*)unoLoc.Country.getStr()); locale->country = SysAllocString((OLECHAR*)unoLoc.Country.getStr());
locale->variant = SysAllocString((OLECHAR*)unoLoc.Variant.getStr()); locale->variant = SysAllocString((OLECHAR*)unoLoc.Variant.getStr());
......
...@@ -230,8 +230,7 @@ private: ...@@ -230,8 +230,7 @@ private:
css::uno::Reference<css::accessibility::XAccessible> m_xAccessible; css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
css::accessibility::XAccessibleAction * m_pXAction; css::accessibility::XAccessibleAction * m_pXAction;
css::accessibility::XAccessibleContext * pRContextInterface; css::uno::Reference<css::accessibility::XAccessibleContext> m_xContext;
css::uno::Reference<css::accessibility::XAccessibleContext> pRContext;
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment