diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-07-10 20:02:50 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-13 13:08:16 +0000 |
commit | 38ae35db26cd5bed2eabc90e1a02afeb4e0eff54 (patch) | |
tree | e564209f0f32585c5fcc90bafb61efcb433f01d1 /unotools | |
parent | 176d54fa5dd4aeda1cc77a1e46b7bfff0c07b8ce (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 'unotools')
-rw-r--r-- | unotools/source/config/cmdoptions.cxx | 9 | ||||
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx index c79ba2ad4168..0f53f1ea52aa 100644 --- a/unotools/source/config/cmdoptions.cxx +++ b/unotools/source/config/cmdoptions.cxx @@ -211,13 +211,16 @@ void SvtCommandOptions_Impl::Notify( const Sequence< OUString >& ) // don't forget to update all existing frames and her might cached dispatch objects! // But look for already killed frames. We hold weak references instead of hard ones ... - for (SvtFrameVector::const_iterator pIt = m_lFrames.begin(); - pIt != m_lFrames.end(); - ++pIt ) + for (SvtFrameVector::iterator pIt = m_lFrames.begin(); pIt != m_lFrames.end(); ) { css::uno::Reference< css::frame::XFrame > xFrame(pIt->get(), css::uno::UNO_QUERY); if (xFrame.is()) + { xFrame->contextChanged(); + ++pIt; + } + else + pIt = m_lFrames.erase(pIt); } } diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 82907d5fb7d8..0f968a85e22a 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -146,13 +146,16 @@ void GlobalEventConfig_Impl::Notify( const Sequence< OUString >& ) // don't forget to update all existing frames and her might cached dispatch objects! // But look for already killed frames. We hold weak references instead of hard ones ... - for (FrameVector::const_iterator pIt = m_lFrames.begin(); - pIt != m_lFrames.end(); - ++pIt ) + for (FrameVector::iterator pIt = m_lFrames.begin(); pIt != m_lFrames.end(); ) { css::uno::Reference< css::frame::XFrame > xFrame(pIt->get(), css::uno::UNO_QUERY); if (xFrame.is()) + { xFrame->contextChanged(); + ++pIt; + } + else + pIt = m_lFrames.erase(pIt); } } |