diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-03-16 11:19:05 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-16 20:18:40 +0100 |
commit | 0a4f7813c4deb26194eba1efe0ff2077460ab599 (patch) | |
tree | 050c44ed14caf70a6fa9384f7b8710ca0783ff6b /accessibility/source/standard/vclxaccessiblelist.cxx | |
parent | 10a48c737d347bcce765c8fbe009bc1dd0bb0c4d (diff) |
Simplify containers iterations in accessibility, avmedia
Use range-based loop or replace with STL functions
Change-Id: I47cabb02a2e52f2af8e87379fc44906d2a732d19
Reviewed-on: https://gerrit.libreoffice.org/69334
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'accessibility/source/standard/vclxaccessiblelist.cxx')
-rw-r--r-- | accessibility/source/standard/vclxaccessiblelist.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 08f57db441e3..315b82975878 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -205,10 +205,9 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool bHasDropDownList) { sal_Int32 i=0; m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND; - for ( ListItems::iterator aIter = m_aAccessibleChildren.begin(); - aIter != m_aAccessibleChildren.end(); ++aIter,++i) + for ( auto& rChild : m_aAccessibleChildren ) { - Reference< XAccessible > xHold = *aIter; + Reference< XAccessible > xHold = rChild; if ( xHold.is() ) { VCLXAccessibleListItem* pItem = static_cast< VCLXAccessibleListItem* >( xHold.get() ); @@ -219,7 +218,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool bHasDropDownList) if ( bNowSelected && !pItem->IsSelected() ) { - xNewAcc = *aIter; + xNewAcc = rChild; aNewValue <<= xNewAcc; } else if ( pItem->IsSelected() ) @@ -231,6 +230,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool bHasDropDownList) { // it could happen that a child was not created before checkEntrySelected(i,aNewValue,xNewAcc); } + ++i; } const sal_Int32 nCount = m_pListBoxHelper->GetEntryCount(); if ( i < nCount ) // here we have to check the if any other listbox entry is selected @@ -670,10 +670,9 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_Int32) { sal_Int32 i=0; m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND; - for ( ListItems::iterator aIter = m_aAccessibleChildren.begin(); - aIter != m_aAccessibleChildren.end(); ++aIter,++i) + for ( auto& rChild : m_aAccessibleChildren ) { - Reference< XAccessible > xHold = *aIter; + Reference< XAccessible > xHold = rChild; if ( xHold.is() ) { VCLXAccessibleListItem* pItem = static_cast< VCLXAccessibleListItem* >( xHold.get() ); @@ -684,7 +683,7 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_Int32) if ( bNowSelected && !pItem->IsSelected() ) { - xNewAcc = *aIter; + xNewAcc = rChild; aNewValue <<= xNewAcc; } else if ( pItem->IsSelected() ) @@ -696,6 +695,7 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_Int32) { // it could happen that a child was not created before checkEntrySelected(i,aNewValue,xNewAcc); } + ++i; } const sal_Int32 nCount = m_pListBoxHelper->GetEntryCount(); if ( i < nCount ) // here we have to check the if any other listbox entry is selected |