summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2018-06-11 17:20:44 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2018-06-12 14:07:06 +0200
commit89f896d2cfd84b711583f98a6343e9835a9aed11 (patch)
tree5b02c36008976ccb7d24a13a495f4f3f7a190303
parente99b6a91d0800acee41ae3b5cbf81be545d93122 (diff)
tdf#118113 MM: Make sure page count is up to date
Since the page layout may have changed, e.g. due to the visibility status of hidden sections having changed in the call to 'pWorkShell->SwViewShell::UpdateFields()', it's necessary to recalculate the layout to ensure that the correct page count is retrieved when calling 'pWorkShell->CalcLayout()'. This fixes a regression introduced by the performance optimization done in commit ae5afe9bcebdd220a457829d47882fe8a0cf69fd, while still avoiding to have to do the expensive layout for the target document. Change-Id: I46f1b68758e4df330c17358a8e852e8b040a9520 Reviewed-on: https://gerrit.libreoffice.org/55636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 54e678280616..6d8694e905df 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1502,6 +1502,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
++targetDocPageCount; // Docs always start on odd pages (so offset must be even).
SwNodeIndex appendedDocStart = pTargetDoc->AppendDoc( *pWorkDoc,
nStartingPageNo, !bWorkDocInitialized, targetDocPageCount, nDocNo);
+ // ensure layout is up to date in order to get correct page count
+ pWorkShell->CalcLayout();
targetDocPageCount += pWorkShell->GetPageCnt();
if ( (nMaxDumpDocs < 0) || (nDocNo <= nMaxDumpDocs) )