diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-10-28 15:44:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-10-28 16:09:07 +0100 |
commit | 9b01059f6e2143c5b5b481f3d321309648fc7dd4 (patch) | |
tree | ceea3dfc7e60f8c1cd954d760bb5ed5a405f2ae9 /sw/source/core/unocore/unoportenum.cxx | |
parent | 7acb634f58e86375f4a3cd4926a560679a45896f (diff) |
SwXTextPortionEnumeration ctor: avoid dynamic_cast in the common case
For a document of 1000 pages and with 1000 bookmarks, this brings a
considerable speedup on ODF export:
before:
real 3m28.187s
after:
real 2m51.565s
Change-Id: Ic3f85c727a8ea4b5012d5c3f0a5887ff47762fb8
Diffstat (limited to 'sw/source/core/unocore/unoportenum.cxx')
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 4d7477217cac..7f70bc55f48a 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -153,14 +153,13 @@ namespace ++ppMark) { ::sw::mark::IMark* const pBkmk = ppMark->get(); - ::sw::mark::CrossRefBookmark *const pCrossRefMark( - dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk)); bool const hasOther = pBkmk->IsExpanded(); const SwPosition& rStartPos = pBkmk->GetMarkStart(); if(rStartPos.nNode == nOwnNode) { // #i109272#: cross reference marks: need special handling! + ::sw::mark::CrossRefBookmark *const pCrossRefMark(dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk)); sal_uInt8 const nType = (hasOther || pCrossRefMark) ? BKM_TYPE_START : BKM_TYPE_START_END; rBkmArr.insert(SwXBookmarkPortion_ImplSharedPtr( @@ -174,6 +173,7 @@ namespace { unique_ptr<SwPosition> pCrossRefEndPos; const SwPosition* pEndPos = NULL; + ::sw::mark::CrossRefBookmark *const pCrossRefMark(dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk)); if(hasOther) { pEndPos = &rEndPos; |