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-06 16:54:55 +0100 |
commit | f373aa0be0a2150c05de5b215f18ed8f0f333e83 (patch) | |
tree | f218432e77d0eb8f88ecc69ddc98198b6a5a9f05 /sw | |
parent | ae5afe9bcebdd220a457829d47882fe8a0cf69fd (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).
Change-Id: I62601ad6dccaa008783d1ce34c9e4f66f9621a56
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 4a0740829142..2d1ce305f444 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1135,8 +1135,6 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ++targetDocPageCount; // Docs always start on odd pages (so offset must be even). 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) ) lcl_SaveDoc( xTargetDocShell, "MergeDoc" ); @@ -1288,6 +1286,7 @@ bool SwDBManager::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)); |