summaryrefslogtreecommitdiff
path: root/dbaccess
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 /dbaccess
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 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 457777652298..d40a8f5c48a6 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -626,15 +626,20 @@ void SAL_CALL ODatabaseModelImpl::disposing( const css::lang::EventObject& Sourc
if ( xCon.is() )
{
bool bStore = false;
- OWeakConnectionArray::const_iterator aEnd = m_aConnections.end();
- for (OWeakConnectionArray::iterator i = m_aConnections.begin(); aEnd != i; ++i)
+ for (OWeakConnectionArray::iterator i = m_aConnections.begin(); i != m_aConnections.end(); )
{
- if ( xCon == i->get() )
+ css::uno::Reference< css::sdbc::XConnection > xIterConn ( *i );
+ if ( !xIterConn.is())
+ {
+ i = m_aConnections.erase(i);
+ }
+ else if ( xCon == xIterConn )
{
*i = css::uno::WeakReference< css::sdbc::XConnection >();
bStore = true;
break;
- }
+ } else
+ ++i;
}
if ( bStore )