summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-28 15:44:06 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-11-14 13:25:28 +0100
commitacb201e5e874443dde7cb80a069a8722be7ce4fa (patch)
tree3fc9cc7bbfd652b674e2d11774049b07ad5d5cfc
parentf84c3330365268b6d8d2c21ddd150ca11857bd1d (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
-rw-r--r--sw/source/core/unocore/unoportenum.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 5bfac66fadd1..201db3374ef0 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -145,14 +145,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(
@@ -168,6 +167,7 @@ namespace
auto_ptr<SwPosition> pCrossRefEndPos;
SAL_WNODEPRECATED_DECLARATIONS_POP
const SwPosition* pEndPos = NULL;
+ ::sw::mark::CrossRefBookmark *const pCrossRefMark(dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk));
if(hasOther)
{
pEndPos = &rEndPos;