diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2014-10-22 13:20:49 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2014-11-14 13:25:19 +0100 |
commit | f84c3330365268b6d8d2c21ddd150ca11857bd1d (patch) | |
tree | bfb1fa7040ccdc274be704ffa2729a3d2da54d9e | |
parent | 57658e82c04d00fda60aaf9e22eb16cd1d6cfbb0 (diff) |
do not repeatedly relayout mailmerge document after each change
When mailmerge uses a single document for all the generated documents, doing
a layout of this increasingly large document after every generated document
addition was getting slower and slower (no wonder). My recent changes should
have removed all needs for any layout in progress, so it should be enough
to just once calculate the final layout. The final layout still appears to be
needed, leaving it as it is to get layout done on the fly puts e.g. 2-page
documents on wrong starting page (maybe just invalidating something would fix
that).
Debug build shows warnings from vdraw.cxx about moving anchor from an invalid
page because of broken layouting, but those were there already before, so I
assume those are not really significant (or at least made worse by this commit).
Conflicts:
sw/source/uibase/dbui/dbmgr.cxx
Change-Id: I62601ad6dccaa008783d1ce34c9e4f66f9621a56
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index a612aa4d2467..62d607f0b89a 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -1219,8 +1219,6 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, SwNodeIndex appendedDocStart = pTargetDoc->AppendDoc(*rWorkShell.GetDoc(), nStartingPageNo, pTargetPageDesc, nDocNo == 1, targetDocPageCount); - // #i72820# calculate layout to be able to find the correct page index - pTargetShell->CalcLayout(); targetDocPageCount += rWorkShell.GetPageCnt(); if ( (nMaxDumpDocs < 0) || (nDocNo <= nMaxDumpDocs) ) @@ -1366,6 +1364,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, // Unfreeze target document layouts and correct all PageDescs. if(rMergeDescriptor.bCreateSingleFile) { + pTargetShell->CalcLayout(); std::set<SwRootFrm*> aAllLayouts = pTargetShell->GetDoc()->GetAllLayouts(); std::for_each( aAllLayouts.begin(), aAllLayouts.end(), ::std::bind2nd(::std::mem_fun(&SwRootFrm::FreezeLayout), false)); |