summaryrefslogtreecommitdiff
path: root/winaccessibility
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-01-05 14:49:24 +0000
committerMichael Weghorn <m.weghorn@posteo.de>2022-01-06 10:11:08 +0100
commit9cbd17314f4e4c04dc5e912bdb2030daddcd2f75 (patch)
tree21a4e8b15e59c9e8f874e862109b980e0827fb0c /winaccessibility
parente523b205364e59f11ae3e735c1440d61427f15d7 (diff)
wina11y: Use range-based for in AccObject::UpdateState
Change-Id: I29793e63ddc040ccbae99012090e975bd80cafc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128011 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'winaccessibility')
-rw-r--r--winaccessibility/source/service/AccObject.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx
index cbda17fa3e77..a9ed6c87a104 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -786,28 +786,25 @@ void AccObject::UpdateState()
return;
}
- Sequence<short> pStates = pRState->getStates();
- int count = pStates.getLength();
-
bool isEnable = false;
bool isShowing = false;
bool isEditable = false;
bool isVisible = false;
bool isFocusable = false;
- for( int iIndex = 0;iIndex < count;iIndex++ )
+ for (const sal_Int16 nState : pRState->getStates())
{
- if( pStates[iIndex] == ENABLED )
+ if (nState == ENABLED)
isEnable = true;
- else if( pStates[iIndex] == SHOWING)
+ else if (nState == SHOWING)
isShowing = true;
- else if( pStates[iIndex] == VISIBLE)
+ else if (nState == VISIBLE)
isVisible = true;
- else if( pStates[iIndex] == EDITABLE )
+ else if (nState == EDITABLE)
isEditable = true;
- else if (pStates[iIndex] == FOCUSABLE)
+ else if (nState == FOCUSABLE)
isFocusable = true;
- IncreaseState( pStates[iIndex]);
+ IncreaseState(nState);
}
bool bIsMenuItem = m_accRole == MENU_ITEM || m_accRole == RADIO_MENU_ITEM || m_accRole == CHECK_MENU_ITEM;