summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dbui
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2019-01-30 17:43:56 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-02-19 17:23:24 +0100
commitb42b3acd043e3d464e2751ff17b0fda462ed62bd (patch)
tree5f09e722b2de8a85771d9dd6c5ba0b3022ebd0b5 /sw/source/uibase/dbui
parent99ceaabc697d6a59f6ba524cd9814cb8d254185f (diff)
tdf#123057 Correct page count in mail merge if sections are hidden
Remove of invisible content has influence on page count and therefore on fields for page count. So straight after removing invisible content in the mail merge process, the layout has to be updated before fields are converted to text. Change-Id: If43f9921b6797c7ceb112860cda4baf4978c36bc Reviewed-on: https://gerrit.libreoffice.org/67343 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source/uibase/dbui')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index fc68894c539d..d5e5790445b1 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1497,6 +1497,9 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
// prepare working copy and target to append
pWorkDoc->RemoveInvisibleContent();
+ // remove of invisible content has influence on page count and so on fields for page count,
+ // therefore layout has to be updated before fields are converted to text
+ pWorkShell->CalcLayout();
pWorkShell->ConvertFieldsToText();
pWorkShell->SetNumberingRestart();
if( bSynchronizedDoc )
@@ -1512,8 +1515,6 @@ 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) )