summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/source/standard/vclxaccessiblelist.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index 66e1fa2d5134..b439dd122fb6 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -165,19 +165,23 @@ void VCLXAccessibleList::notifyVisibleStates(bool _bSetNew )
NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
ListItems::iterator aIter = m_aAccessibleChildren.begin();
- ListItems::iterator aEnd = m_aAccessibleChildren.end();
UpdateVisibleLineCount();
// adjust the index inside the VCLXAccessibleListItem
- for (;aIter != aEnd ; ++aIter)
+ for ( ; aIter != m_aAccessibleChildren.end(); )
{
Reference< XAccessible > xHold = *aIter;
- VCLXAccessibleListItem* pItem = static_cast<VCLXAccessibleListItem*>(xHold.get());
- if ( pItem )
+ if (!xHold.is())
{
+ aIter = m_aAccessibleChildren.erase(aIter);
+ }
+ else
+ {
+ VCLXAccessibleListItem* pItem = static_cast<VCLXAccessibleListItem*>(xHold.get());
const sal_Int32 nTopEntry = m_pListBoxHelper ? m_pListBoxHelper->GetTopEntry() : 0;
const sal_Int32 nPos = static_cast<sal_Int32>(aIter - m_aAccessibleChildren.begin());
bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + m_nVisibleLineCount ) );
pItem->SetVisible( m_bVisible && bVisible );
+ ++aIter;
}
}