summaryrefslogtreecommitdiff
path: root/comphelper/source/eventattachermgr/eventattachermgr.cxx
diff options
context:
space:
mode:
authorAron Budea <baron@caesar.elte.hu>2016-04-25 04:04:24 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-04-26 09:40:56 +0000
commitf91674bd4b5022a63dc5e6a89fe9a1b832d96798 (patch)
tree82587361a5c7deac5958ef2cd83ef28756afe09a /comphelper/source/eventattachermgr/eventattachermgr.cxx
parent6046062719f30849cd97161c6a89d27a0b0d2a20 (diff)
tdf#60418: improve perf of opening/closing odts with form tags
Opening/closing times using "Without Frame tags" attached file from bug report changed as follows on my system (debug build): open: 2:06 -> 1:32 close (doc unchanged): 1:52 -> 0:18 The performance fixes in the different CXX files are independent, eventattachermgr.cxx is related to doc close, the others to doc open. Change-Id: I24fc4558f79b9123494a3939c0a313fcd47a067f Reviewed-on: https://gerrit.libreoffice.org/24359 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper/source/eventattachermgr/eventattachermgr.cxx')
-rw-r--r--comphelper/source/eventattachermgr/eventattachermgr.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index 70fbe1c756b6..e4f0698509ce 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -394,18 +394,12 @@ Reference< XIdlReflection > ImplEventAttacherManager::getReflection() throw( Exc
}
-::std::deque<AttacherIndex_Impl>::iterator ImplEventAttacherManager::implCheckIndex( sal_Int32 _nIndex )
+::std::deque< AttacherIndex_Impl >::iterator ImplEventAttacherManager::implCheckIndex( sal_Int32 _nIndex )
{
- if (_nIndex < 0)
- throw IllegalArgumentException();
-
- ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
- for ( sal_Int32 i = 0; (i < _nIndex) && (aIt != aIndex.end()); ++i, ++aIt )
- ;
-
- if( aIt == aIndex.end() )
+ if ( (_nIndex < 0) || (static_cast<sal_uInt32>(_nIndex) >= aIndex.size()) )
throw IllegalArgumentException();
+ ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin() + _nIndex;
return aIt;
}