Kaydet (Commit) f8854116 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

clang-cl loplugin: winaccessibility

Change-Id: I40f8a6fef9d66b28a1d72551a6873b041b38b09d
Reviewed-on: https://gerrit.libreoffice.org/29840Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst dd63b743
......@@ -39,7 +39,7 @@ private:
static FILE *output, *output2, *output3, *outacc;//used for debugging
public:
AccComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccComponentEventListener();
virtual ~AccComponentEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -39,7 +39,7 @@ class AccContainerEventListener: public AccEventListener
{
public:
AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccContainerEventListener();
virtual ~AccContainerEventListener() override;
//AccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......@@ -69,7 +69,7 @@ public:
virtual void SetComponentState(short state, bool enable) override;
virtual void FireStatePropertyChange(short state, bool set) override;
virtual void FireStateFocusedChange(bool enable) override;
virtual bool IsEditable(css::uno::Reference<css::accessibility::XAccessibleContext> xContext);
virtual bool IsEditable(css::uno::Reference<css::accessibility::XAccessibleContext> const & xContext);
// update all children's state
void UpdateAllChildrenState( css::accessibility::XAccessible* pXAccessible);
......
......@@ -36,10 +36,10 @@ class AccDescendantManagerEventListener: public AccComponentEventListener
public:
AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccDescendantManagerEventListener();
virtual ~AccDescendantManagerEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException);
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
//for selection changed event
virtual void HandleSelectionChangedEvent(
......
......@@ -35,7 +35,7 @@ class AccDialogEventListener: public AccEventListener
{
public:
AccDialogEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccDialogEventListener();
virtual ~AccDialogEventListener() override;
//AccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -45,7 +45,7 @@ protected:
AccObjectManagerAgent* pAgent;
public:
AccEventListener( css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccEventListener();
virtual ~AccEventListener() override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException) override;
......
......@@ -36,7 +36,7 @@ class AccFrameEventListener: public AccEventListener
{
public:
AccFrameEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccFrameEventListener();
virtual ~AccFrameEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -36,7 +36,7 @@ class AccListEventListener: public AccDescendantManagerEventListener
{
public:
AccListEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccListEventListener();
virtual ~AccListEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -36,7 +36,7 @@ class AccMenuEventListener: public AccComponentEventListener
{
public:
AccMenuEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccMenuEventListener();
virtual ~AccMenuEventListener() override;
//AccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -57,7 +57,7 @@ private:
short m_accRole;
long m_resID;
HWND m_pParantID;
sal_Bool m_bShouldDestroy; //avoid access COM interface when acc object is deleted
bool m_bShouldDestroy; //avoid access COM interface when acc object is deleted
IMAccessible* m_pIMAcc;
AccObject* m_pParentObj;
IAccChildList m_childrenList;
......@@ -80,10 +80,10 @@ private:
public:
AccObject ( css::accessibility::XAccessible* pXAcc = NULL,AccObjectManagerAgent* pAgent = NULL ,AccEventListener* accListener=NULL);
AccObject ( css::accessibility::XAccessible* pXAcc = nullptr,AccObjectManagerAgent* pAgent = nullptr ,AccEventListener* accListener=nullptr);
virtual ~AccObject();
sal_Bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping
bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping
void UpdateDefaultAction();
IMAccessible* GetIMAccessible(); //return COM interface in acc object
......@@ -106,8 +106,8 @@ public:
void DeleteChild( AccObject* pChild );
AccObject* NextChild();
void NotifyDestroy(sal_Bool ifDelete);
sal_Bool ifShouldDestroy();
void NotifyDestroy(bool ifDelete);
bool ifShouldDestroy();
void DecreaseState(short xState );//call COM interface DecreaseState method
void IncreaseState( short xState );//call COM interface IncreaseState method
......
......@@ -36,7 +36,7 @@ class AccObjectContainerEventListener: public AccContainerEventListener
{
public:
AccObjectContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccObjectContainerEventListener();
virtual ~AccObjectContainerEventListener() override;
virtual void HandleStateChangedEvent(
css::uno::Any oldValue, css::uno::Any newValue) override;
......
......@@ -53,7 +53,7 @@ public:
virtual void DeleteAccObj( css::accessibility::XAccessible* pXAcc );
virtual IMAccessible* GetIMAccByXAcc(css::accessibility::XAccessible* pXAcc);
bool NotifyAccEvent(short pEvent = 0, css::accessibility::XAccessible* pXAcc = 0);
bool NotifyAccEvent(short pEvent = 0, css::accessibility::XAccessible* pXAcc = nullptr);
bool InsertChildrenAccObj(css::accessibility::XAccessible* pXAcc,
sal_Int64 pWnd=0);
......@@ -63,7 +63,7 @@ public:
void IncreaseState( css::accessibility::XAccessible* pXAcc,unsigned short pState );
void UpdateState( css::accessibility::XAccessible* pXAcc );
void UpdateLocation( css::accessibility::XAccessible* pXAcc,
static void UpdateLocation( css::accessibility::XAccessible* pXAcc,
long Top = 0,long left = 0,long width = 0,long height = 0 );
void UpdateAction( css::accessibility::XAccessible* pXAcc );
......
......@@ -78,7 +78,7 @@ private:
AccObjectManagerAgent* pAgent;
ResIDGenerator ResIdGen;
AccObjectWinManager(AccObjectManagerAgent* Agent=NULL);
AccObjectWinManager(AccObjectManagerAgent* Agent=nullptr);
private:
long ImpleGenerateResID();
......@@ -88,9 +88,9 @@ private:
css::accessibility::XAccessible* GetAccDocByHWND(HWND hWnd);
void DeleteAccListener( AccObject* pAccObj );
void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd);
void DeleteAccChildNode(AccObject* pChild);
static void DeleteAccListener( AccObject* pAccObj );
static void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd);
static void DeleteAccChildNode(AccObject* pChild);
void DeleteFromHwndXAcc(css::accessibility::XAccessible* pXAcc );
int UpdateAccSelection(css::accessibility::XAccessible* pXAcc);
......@@ -98,12 +98,12 @@ private:
css::accessibility::XAccessible* pXAcc);
public:
virtual ~AccObjectWinManager();
sal_Bool InsertAccObj( css::accessibility::XAccessible* pXAcc,css::accessibility::XAccessible* pParentXAcc,HWND pWnd);
sal_Bool InsertChildrenAccObj( css::accessibility::XAccessible* pXAcc,HWND pWnd=0);
bool InsertAccObj( css::accessibility::XAccessible* pXAcc,css::accessibility::XAccessible* pParentXAcc,HWND pWnd);
bool InsertChildrenAccObj( css::accessibility::XAccessible* pXAcc,HWND pWnd=nullptr);
void DeleteAccObj( css::accessibility::XAccessible* pXAcc );
void DeleteChildrenAccObj(css::accessibility::XAccessible* pAccObj);
sal_Bool NotifyAccEvent( css::accessibility::XAccessible* pXAcc,short state = 0 );
bool NotifyAccEvent( css::accessibility::XAccessible* pXAcc,short state = 0 );
LPARAM Get_ToATInterface(HWND hWnd, long lParam, WPARAM wParam);
......@@ -127,7 +127,7 @@ public:
void UpdateAccFocus( css::accessibility::XAccessible* newFocus );
void UpdateAction( css::accessibility::XAccessible* pXAcc );
sal_Bool IsContainer( css::accessibility::XAccessible* pAccessible );
static bool IsContainer( css::accessibility::XAccessible* pAccessible );
IMAccessible* GetIMAccByXAcc( css::accessibility::XAccessible* pXAcc );
IMAccessible* GetIAccessibleFromResID(long resID);
......@@ -142,12 +142,12 @@ public:
bool IsSpecialToolboItem(css::accessibility::XAccessible* pXAcc);
short GetRole(css::accessibility::XAccessible* pXAcc);
static short GetRole(css::accessibility::XAccessible* pXAcc);
css::accessibility::XAccessible* GetAccDocByAccTopWin( css::accessibility::XAccessible* pXAcc );
bool IsTopWinAcc( css::accessibility::XAccessible* pXAcc );
bool IsStateManageDescendant(css::accessibility::XAccessible* pAccessible);
static bool IsStateManageDescendant(css::accessibility::XAccessible* pAccessible);
};
#endif // INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTWINMANAGER_HXX
......
......@@ -36,7 +36,7 @@ class AccParagraphEventListener: public AccContainerEventListener
{
public:
AccParagraphEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccParagraphEventListener();
virtual ~AccParagraphEventListener() override;
//AccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -36,10 +36,10 @@ class AccTableEventListener: public AccDescendantManagerEventListener
{
public:
AccTableEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccTableEventListener();
virtual ~AccTableEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException);
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
//for active descendant changed event
virtual void HandleActiveDescendantChangedEvent(
......
......@@ -36,7 +36,7 @@ class AccTextComponentEventListener: public AccComponentEventListener
{
public:
AccTextComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccTextComponentEventListener();
virtual ~AccTextComponentEventListener() override;
virtual void SetComponentState(short state, bool enable) override;
......
......@@ -42,19 +42,19 @@ private:
AccObjectManagerAgent accManagerAgent;
public:
AccTopWindowListener();
virtual ~AccTopWindowListener();
virtual ~AccTopWindowListener() override;
// XTopWindowListener
virtual void SAL_CALL windowOpened( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowClosing( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowClosed( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowMinimized( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowNormalized( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowActivated( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowDeactivated( const css::lang::EventObject& e ) throw (css::uno::RuntimeException);
virtual void SAL_CALL windowOpened( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
virtual void SAL_CALL windowClosing( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
virtual void SAL_CALL windowClosed( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
virtual void SAL_CALL windowMinimized( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
virtual void SAL_CALL windowNormalized( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
virtual void SAL_CALL windowActivated( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
virtual void SAL_CALL windowDeactivated( const css::lang::EventObject& e ) throw (css::uno::RuntimeException) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException);
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException) override;
virtual void AddAllListeners(css::accessibility::XAccessible* pAccessible,css::accessibility::XAccessible* pParentXAcc,HWND pWND );
//for On-Demand load.
......
......@@ -36,10 +36,10 @@ class AccTreeEventListener: public AccDescendantManagerEventListener
{
public:
AccTreeEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccTreeEventListener();
virtual ~AccTreeEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException);
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
//for active descendant changed event
virtual void HandleActiveDescendantChangedEvent(
......
......@@ -36,7 +36,7 @@ class AccWindowEventListener: public AccEventListener
{
public:
AccWindowEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
virtual ~AccWindowEventListener();
virtual ~AccWindowEventListener() override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) throw (css::uno::RuntimeException) override;
......
......@@ -101,16 +101,6 @@ STDMETHODIMP CAccAction::get_keyBinding(
return CAccActionBase::get_keyBinding(actionIndex, nMaxBinding, keyBinding, nBinding);
}
/**
* Override of IUNOXWrapper.
*
* @param pXInterface the pointer of UNO interface.
*/
STDMETHODIMP CAccAction::put_XInterface(hyper pXInterface)
{
return CAccActionBase::put_XInterface(pXInterface);
}
/**
* Put UNO interface.
* @param pXSubInterface XAccessibleHyperlink interface.
......
......@@ -37,7 +37,7 @@ public:
{
}
~CAccAction()
~CAccAction() override
{
}
......@@ -47,13 +47,20 @@ public:
BEGIN_COM_MAP(CAccAction)
COM_INTERFACE_ENTRY(IAccessibleAction)
COM_INTERFACE_ENTRY(IUNOXWrapper)
COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,SmartQI_)
#if defined __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
#endif
END_COM_MAP()
#if defined __clang__
#pragma clang diagnostic pop
#endif
static HRESULT WINAPI _SmartQI(void* pv,
static HRESULT WINAPI SmartQI_(void* pv,
REFIID iid, void** ppvObject, DWORD_PTR)
{
return ((CAccAction*)pv)->SmartQI(iid,ppvObject);
return static_cast<CAccAction*>(pv)->SmartQI(iid,ppvObject);
}
HRESULT SmartQI(REFIID iid, void** ppvObject)
......@@ -68,20 +75,20 @@ public:
// IAccessibleAction
// Returns the number of action.
STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
STDMETHOD(nActions)(/*[out,retval]*/long* nActions) override;
// Performs specified action on the object.
STDMETHOD(doAction)(/* [in] */ long actionIndex);
STDMETHOD(doAction)(/* [in] */ long actionIndex) override;
// Gets description of specified action.
STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description) override;
// added , 2006/06/28, for driver 07/11
// get the action name
STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name) override;
// get the localized action name
STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName) override;
// Returns key binding object (if any) associated with specified action
// key binding is string.
......@@ -90,13 +97,10 @@ public:
/* [in] */ long actionIndex,
/* [in] */ long nMaxBinding,
/* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
/* [retval][out] */ long __RPC_FAR *nBinding);
/* [retval][out] */ long __RPC_FAR *nBinding) override;
// Override of IUNOXWrapper.
STDMETHOD(put_XInterface)(hyper pXInterface);
// Override of IUNOXWrapper.
STDMETHOD(put_XSubInterface)(hyper pXSubInterface);
STDMETHOD(put_XSubInterface)(hyper pXSubInterface) override;
};
......
......@@ -49,57 +49,6 @@ CAccActionBase::CAccActionBase()
CAccActionBase::~CAccActionBase()
{}
/**
* Helper function used for getting default action by UNO role.
*
* @param pRContext UNO context interface pointer.
* @param pRet the corresponding string to be returned.
*/
void GetDfActionByUNORole(XAccessibleContext* pRContext, BSTR* pRet)
{
// #CHECK#
if(pRContext == NULL || pRet == NULL)
{
return;
}
long Role = pRContext->getAccessibleRole();
switch(Role)
{
case PUSH_BUTTON:
*pRet = ::SysAllocString(PRESS_STR);
break;
case RADIO_BUTTON:
case MENU_ITEM:
case LIST_ITEM:
*pRet = ::SysAllocString(SELECT_STR);
break;
case CHECK_BOX:
{
Reference< XAccessibleStateSet > pRState = pRContext->getAccessibleStateSet();
if( !pRState.is() )
{
return;
}
Sequence<short> pStates = pRState->getStates();
int count = pStates.getLength();
*pRet = ::SysAllocString(CHECK_STR);
for( int iIndex = 0;iIndex < count;iIndex++ )
{
if( pStates[iIndex] == AccessibleStateType::CHECKED )
{
SAFE_SYSFREESTRING(*pRet);
*pRet = ::SysAllocString(UNCHECK_STR);
break;
}
}
break;
}
}
}
/**
* Returns the number of action.
*
......@@ -112,7 +61,7 @@ STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long* nActions)
ENTER_PROTECTED_BLOCK
// #CHECK#
if( pRXAct.is() && nActions != NULL )
if( pRXAct.is() && nActions != nullptr )
{
*nActions = GetXInterface()->getAccessibleActionCount();
return S_OK;
......@@ -157,7 +106,7 @@ STDMETHODIMP CAccActionBase::get_description(long actionIndex,BSTR __RPC_FAR *de
ENTER_PROTECTED_BLOCK
// #CHECK#
if(description == NULL)
if(description == nullptr)
return E_INVALIDARG;
// #CHECK XInterface#
......@@ -168,7 +117,7 @@ STDMETHODIMP CAccActionBase::get_description(long actionIndex,BSTR __RPC_FAR *de
// #CHECK#
SAFE_SYSFREESTRING(*description);
*description = SysAllocString((OLECHAR*)ouStr.getStr());
*description = SysAllocString(ouStr.getStr());
return S_OK;
......@@ -219,10 +168,10 @@ STDMETHODIMP CAccActionBase::get_keyBinding(
OLECHAR wString[64];
*keyBinding = (BSTR*)::CoTaskMemAlloc(nCount*sizeof(BSTR));
*keyBinding = static_cast<BSTR*>(::CoTaskMemAlloc(nCount*sizeof(BSTR)));
// #CHECK Memory Allocation#
if(*keyBinding == NULL)
if(*keyBinding == nullptr)
return E_FAIL;
for( int index = 0;index < nCount;index++ )
......@@ -253,7 +202,7 @@ STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterface)
CUNOXWrapper::put_XInterface(pXInterface);
//special query.
if(pUNOInterface == NULL)
if(pUNOInterface == nullptr)
return E_FAIL;
Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
if( !pRContext.is() )
......@@ -261,7 +210,7 @@ STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterface)
Reference<XAccessibleAction> pRXI(pRContext,UNO_QUERY);
if( !pRXI.is() )
pRXAct = NULL;
pRXAct = nullptr;
else
pRXAct = pRXI.get();
return S_OK;
......@@ -278,7 +227,7 @@ STDMETHODIMP CAccActionBase::put_XInterface(hyper pXInterface)
void CAccActionBase::GetkeyBindingStrByXkeyBinding( const Sequence< KeyStroke > &keySet, OLECHAR* pString )
{
// #CHECK#
if(pString == NULL)
if(pString == nullptr)
return;
for( int iIndex = 0;iIndex < keySet.getLength();iIndex++ )
......@@ -381,7 +330,7 @@ OLECHAR const * CAccActionBase::getOLECHARFromKeyCode(long key)
}
else
{
return NULL;
return nullptr;
}
}
......
......@@ -62,7 +62,7 @@ public:
/* [retval][out] */ long __RPC_FAR *nBinding);
// Override of IUNOXWrapper.
STDMETHOD(put_XInterface)(hyper pXInterface);
STDMETHOD(put_XInterface)(hyper pXInterface) override;
static void GetkeyBindingStrByXkeyBinding( const css::uno::Sequence< css::awt::KeyStroke > &keySet, OLECHAR* pString );
......
......@@ -66,15 +66,4 @@ STDMETHODIMP CAccComponent::get_background(IA2Color * background)
return CAccComponentBase::get_background(background);
}
/**
* Override of IUNOXWrapper.
*
* @param pXInterface the pointer of UNO interface.
*/
STDMETHODIMP CAccComponent::put_XInterface(hyper pXInterface)
{
return CAccComponentBase::put_XInterface(pXInterface);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -42,20 +42,27 @@ public:
CAccComponent()
{
}
~CAccComponent()
~CAccComponent() override
{
}
BEGIN_COM_MAP(CAccComponent)
COM_INTERFACE_ENTRY(IAccessibleComponent)
COM_INTERFACE_ENTRY(IUNOXWrapper)
COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,SmartQI_)
#if defined __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
#endif
END_COM_MAP()
#if defined __clang__
#pragma clang diagnostic pop
#endif
static HRESULT WINAPI _SmartQI(void* pv,
static HRESULT WINAPI SmartQI_(void* pv,
REFIID iid, void** ppvObject, DWORD_PTR)
{
return ((CAccComponent*)pv)->SmartQI(iid,ppvObject);
return static_cast<CAccComponent*>(pv)->SmartQI(iid,ppvObject);
}
HRESULT SmartQI(REFIID iid, void** ppvObject)
......@@ -72,17 +79,13 @@ public:
// Returns the location of the upper left corner of the object's bounding
// box relative to the parent.
STDMETHOD(get_locationInParent)(long *x, long *y);
STDMETHOD(get_locationInParent)(long *x, long *y) override;
// Returns the foreground color of this object.
STDMETHOD(get_foreground)(IA2Color * foreground);
STDMETHOD(get_foreground)(IA2Color * foreground) override;
// Returns the background color of this object.
STDMETHOD(get_background)(IA2Color * background);
// Override of IUNOXWrapper.
STDMETHOD(put_XInterface)(hyper pXInterface);
STDMETHOD(get_background)(IA2Color * background) override;
};
#endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCCOMPONENT_H
......
......@@ -50,7 +50,7 @@ STDMETHODIMP CAccComponentBase::get_locationInParent(long *x, long *y)
try
{
if (x == NULL || y == NULL)
if (x == nullptr || y == nullptr)
return E_INVALIDARG;
// #CHECK XInterface#
if(!pRXComp.is())
......@@ -80,7 +80,7 @@ STDMETHODIMP CAccComponentBase::get_locationOnScreen(long *x, long *y)
try
{
if (x == NULL || y == NULL)
if (x == nullptr || y == nullptr)
return E_INVALIDARG;
// #CHECK XInterface#
if(!pRXComp.is())
......@@ -109,7 +109,7 @@ STDMETHODIMP CAccComponentBase::grabFocus(boolean * success)
ENTER_PROTECTED_BLOCK
if (success == NULL)
if (success == nullptr)
return E_INVALIDARG;
// #CHECK XInterface#
if(!pRXComp.is())
......@@ -135,7 +135,7 @@ STDMETHODIMP CAccComponentBase::get_foreground(IA2Color * foreground)
ENTER_PROTECTED_BLOCK
if (foreground == NULL)
if (foreground == nullptr)
return E_INVALIDARG;
// #CHECK XInterface#
if(!pRXComp.is())
......@@ -160,7 +160,7 @@ STDMETHODIMP CAccComponentBase::get_background(IA2Color * background)
ENTER_PROTECTED_BLOCK
if (background == NULL)
if (background == nullptr)
return E_INVALIDARG;
// #CHECK XInterface#
if(!pRXComp.is())
......@@ -187,7 +187,7 @@ STDMETHODIMP CAccComponentBase::put_XInterface(hyper pXInterface)
CUNOXWrapper::put_XInterface(pXInterface);
//special query.
if(pUNOInterface == NULL)
if(pUNOInterface == nullptr)
return E_FAIL;
Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
if( !pRContext.is() )
......@@ -196,7 +196,7 @@ STDMETHODIMP CAccComponentBase::put_XInterface(hyper pXInterface)
}
Reference<XAccessibleComponent> pRXI(pRContext,UNO_QUERY);
if( !pRXI.is() )
pRXComp = NULL;
pRXComp = nullptr;
else
pRXComp = pRXI.get();
......
......@@ -53,7 +53,7 @@ public:
STDMETHOD(get_background)(IA2Color * background);
// Override of IUNOXWrapper.