summaryrefslogtreecommitdiff
path: root/winaccessibility/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-03 21:00:37 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-12 20:06:24 +0100
commita5c7ed21584b024d52d32917d1b07462a00e7405 (patch)
tree97d8e6b2e082ab10e1ff71b6a2faca4621fab535 /winaccessibility/source
parent9d71c9a442b2be027900f7b20342e2a0f43ed2ab (diff)
winaccessibility: use SAL_N_ELEMENTS
Change-Id: I479117e0794375f1ec0c96b78db22b3569b456ec
Diffstat (limited to 'winaccessibility/source')
-rw-r--r--winaccessibility/source/UAccCOM/AccActionBase.cxx3
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx2
-rw-r--r--winaccessibility/source/UAccCOM/acccommon.h4
-rw-r--r--winaccessibility/source/service/AccObject.cxx2
4 files changed, 4 insertions, 7 deletions
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx
index 982e58f21677..d23b12659659 100644
--- a/winaccessibility/source/UAccCOM/AccActionBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -334,6 +334,7 @@ OLECHAR* CAccActionBase::getOLECHARFromKeyCode(long key)
}
map[] =
{
+#define CODEENTRY(key) {KEYCODE_##key, L#key}
{MODIFIER_SHIFT, L"SHIFT" },
{MODIFIER_CTRL, L"CTRL" },
{MODIFIER_ALT, L"ALT" },
@@ -386,7 +387,7 @@ OLECHAR* CAccActionBase::getOLECHARFromKeyCode(long key)
{ KEYCODE_CONTEXTMENU, L"CONTEXTMENU" },
{ KEYCODE_HELP, L"HELP" },
};
- static long nCount = countof(map);
+ static long nCount = SAL_N_ELEMENTS(map);
long min = 0;
long max = nCount-1;
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 62efd2f10a53..e7d9d3900796 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -3098,7 +3098,7 @@ STDMETHODIMP CMAccessible:: get_states(AccessibleStates __RPC_FAR *states )
*states = 0x0;
for( int i = 0; i < count; i++ )
{
- for( int j = 0; j < sizeof(UNO_STATES) / sizeof(UNO_STATES[0]); j++ )
+ for( int j = 0; j < SAL_N_ELEMENTS(UNO_STATES); j++ )
{
if( pStates[i] == UNO_STATES[j] )
{
diff --git a/winaccessibility/source/UAccCOM/acccommon.h b/winaccessibility/source/UAccCOM/acccommon.h
index 9ca1382c8e30..9dc336a58632 100644
--- a/winaccessibility/source/UAccCOM/acccommon.h
+++ b/winaccessibility/source/UAccCOM/acccommon.h
@@ -63,10 +63,6 @@ inline BOOL ImplIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
#define InlineIsEqualGUID ImplIsEqualGUID
//End
-//for AccAction.cxx
-#define CODEENTRY(key) \
- {KEYCODE_##key, L#key}
-#define countof(x) (sizeof(x)/sizeof(x[0]))
#define SELECT L"Select"
#define PRESS L"Press"
diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx
index 39a95348da83..b14d31435bbf 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -792,7 +792,7 @@ void AccObject::UpdateRole()
XAccessibleContext* pContext = m_xAccContextRef.get();
m_pIMAcc->Put_XAccRole( ROLE_SYSTEM_WINDOW );
short iRoleIndex = pContext->getAccessibleRole();
- if (( 0 <= iRoleIndex) && ( iRoleIndex <= (sizeof(ROLE_TABLE)/(sizeof(short)*2))))
+ if ((0 <= iRoleIndex) && (iRoleIndex < SAL_N_ELEMENTS(ROLE_TABLE)))
{
short iIA2Role = ROLE_TABLE[iRoleIndex][1] ;
m_pIMAcc->Put_XAccRole( iIA2Role );