summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-07-10 20:02:50 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-07-13 13:08:16 +0000
commit38ae35db26cd5bed2eabc90e1a02afeb4e0eff54 (patch)
treee564209f0f32585c5fcc90bafb61efcb433f01d1 /accessibility
parent176d54fa5dd4aeda1cc77a1e46b7bfff0c07b8ce (diff)
tdf#84635 - Slow layout of large tables
Based on suggestion from Aron Budea. And do something similar to most other places keeping vectors of weak references where the code looks like it will hold more than a few entries. Measurements: the 26 page file file takes 51s without my path 15s with this patch the 69 page file file takes 5m28 without my path 51s with this patch the 84 page file file takes 8m28 without my path 58s with this patch Change-Id: I8da94c525fc73ebd969e0343c6f074be4f0063b1 Reviewed-on: https://gerrit.libreoffice.org/27093 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
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;
}
}