winaccessibility: make XAccessibleAction member Reference
Maybe it would be kept alive by AccObject::m_AccActionRef but why not play it safe. Change-Id: I03c2be04e97dcde8a177ef8dfd0d75595ab13a53
This commit is contained in:
@@ -207,7 +207,6 @@ m_pszValue(NULL),
|
||||
m_pszDescription(NULL),
|
||||
m_isDestroy(FALSE),
|
||||
m_pszActionDescription(NULL),
|
||||
m_pXAction(NULL),
|
||||
m_bRequiresSave(FALSE)
|
||||
{
|
||||
m_sLocation.m_dLeft=0;
|
||||
@@ -2409,7 +2408,7 @@ STDMETHODIMP CMAccessible::GetUNOInterface(hyper * pXAcc)
|
||||
*/
|
||||
STDMETHODIMP CMAccessible::SetDefaultAction(hyper pAction)
|
||||
{
|
||||
m_pXAction = reinterpret_cast<XAccessibleAction*>(pAction);
|
||||
m_xAction = reinterpret_cast<XAccessibleAction*>(pAction);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -2434,7 +2433,7 @@ HRESULT STDMETHODCALLTYPE CMAccessible::get_accDefaultAction(VARIANT varChild, B
|
||||
{
|
||||
if(varChild.lVal==CHILDID_SELF)
|
||||
{
|
||||
if( m_pXAction == NULL )
|
||||
if (!m_xAction.is())
|
||||
return DISP_E_MEMBERNOTFOUND;
|
||||
SAFE_SYSFREESTRING(*pszDefaultAction);
|
||||
*pszDefaultAction = SysAllocString(m_pszActionDescription);
|
||||
@@ -2465,15 +2464,15 @@ HRESULT STDMETHODCALLTYPE CMAccessible::accDoDefaultAction(VARIANT varChild)
|
||||
ISDESTROY()
|
||||
if( varChild.vt != VT_I4 )
|
||||
return E_INVALIDARG;
|
||||
if( m_pXAction == NULL )
|
||||
if (!m_xAction.is())
|
||||
return E_FAIL;
|
||||
if( m_pXAction->getAccessibleActionCount() == 0 )
|
||||
if (m_xAction->getAccessibleActionCount() == 0)
|
||||
return E_FAIL;
|
||||
|
||||
if(varChild.lVal==CHILDID_SELF)
|
||||
{
|
||||
if(m_pXAction->getAccessibleActionCount() > 0)
|
||||
m_pXAction->doAccessibleAction(0);
|
||||
if (m_xAction->getAccessibleActionCount() > 0)
|
||||
m_xAction->doAccessibleAction(0);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,9 @@ private:
|
||||
BOOL m_isDestroy;
|
||||
|
||||
css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
|
||||
css::accessibility::XAccessibleAction * m_pXAction;
|
||||
// initially m_xAction and m_xContext are the same object
|
||||
// but they may be different once AccObject::UpdateAction() is called?
|
||||
css::uno::Reference<css::accessibility::XAccessibleAction> m_xAction;
|
||||
css::uno::Reference<css::accessibility::XAccessibleContext> m_xContext;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user