winaccessibility/source/service/AccObject.cxx | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-)
New commits: commit df80ed941621da16459c16eae04f73300a606c9b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Mar 1 10:05:41 2022 +0000 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Mar 1 15:51:27 2022 +0100 wina11y: Use range-based for Change-Id: Icf2a4cb3a4baf0c7aaeb627d05ba355f238b4d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130756 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx index 87556090941f..d2862577ffb2 100644 --- a/winaccessibility/source/service/AccObject.cxx +++ b/winaccessibility/source/service/AccObject.cxx @@ -432,14 +432,8 @@ OUString AccObject::GetMAccessibleValueFromAny(Any pAny) Sequence< OUString > val; if (pAny >>= val) { - - int count = val.getLength(); - - for( int iIndex = 0;iIndex < count;iIndex++ ) - { - strValue += val[iIndex]; - } - + for (const OUString& rElem : val) + strValue += rElem; } } else if(pAny.getValueType() == cppu::UnoType<double>::get()) @@ -1052,19 +1046,12 @@ void AccObject::GetExpandedState( sal_Bool* isExpandable, sal_Bool* isExpanded) return; } - Sequence<short> pStates = pRState->getStates(); - int count = pStates.getLength(); - - for( int iIndex = 0;iIndex < count;iIndex++ ) + for (sal_Int16 nState : pRState->getStates()) { - if( EXPANDED == pStates[iIndex] ) - { + if (nState == EXPANDED) *isExpanded = true; - } - else if( EXPANDABLE == pStates[iIndex] ) - { + else if (nState == EXPANDABLE) *isExpandable = true; - } } }