diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-08 09:07:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-08 18:39:54 +0000 |
commit | b23d55ccc24a37c60d39061a4e497181b9609e9b (patch) | |
tree | ef2229daa31bbe5d1dc53c48c84d8c7b2bfbb4e8 /sw/source/core/unocore/unotext.cxx | |
parent | 098d08d6af951afa4f20f6f7883f6c9d34e87e11 (diff) |
tdf#88812 sw: speed up SwDoc::MakeFlyAndMove()
In this function the anchor is not set by the time CopyRange() is
called, so the check always returns false, but in worst case it's O(n^3)
wrt. the number of fly frames in the document, so it's a significant
cost to perform that check.
Before:
$ time OOO_EXIT_POST_STARTUP=1 instdir/program/soffice.bin --headless /home/vmiklos/orig.rtf
real 0m46.833s
After:
$ time OOO_EXIT_POST_STARTUP=1 instdir/program/soffice.bin --headless /home/vmiklos/orig.rtf
real 0m26.832s
Change-Id: I7ab9565634e4df7e0adc701908815f778dc59d32
Reviewed-on: https://gerrit.libreoffice.org/15197
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/core/unocore/unotext.cxx')
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 6d6c74233013..3374de07a4e5 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2356,7 +2356,7 @@ throw (uno::RuntimeException, std::exception) SwNodeIndex rNdIndex( *GetStartNode( ), 1 ); SwPosition rPos( rNdIndex ); - m_pImpl->m_pDoc->getIDocumentContentOperations().CopyRange( *pCursor->GetPaM(), rPos, false ); + m_pImpl->m_pDoc->getIDocumentContentOperations().CopyRange( *pCursor->GetPaM(), rPos, /*bCopyAll=*/false, /*bCheckPos=*/true ); } SwXBodyText::SwXBodyText(SwDoc *const pDoc) |