summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-12-19 00:35:32 +0300
committerMichael Stahl <Michael.Stahl@cib.de>2019-01-16 16:07:26 +0100
commit69fcd630f18041c4363de2a1e2aa17d5c53ddca1 (patch)
tree591cd3ba5e067ac737c270fb74e8ad166dd1fc55 /sw/source
parent960313f0b79fcc4a126b59aafad53efba13dfeb3 (diff)
tdf#121168: Ensure page descriptions are correct in work document
When first node on a page is a section, then creation of a copy with lcl_CreateWorkingDocument initially produces a document with layout frames having wrong page descriptions applied (set to "Default Style"). The reason is that when SfxViewFrame::LoadHiddenDocument indirectly calls SwRootFrame::Init, the sections in the document have hidden flag set, which causes SwNodes::GoNextSection return the first node after the first section. The returned node naturally doesn't have a page description set, thus the initialized page frame doesn't get it. This makes following copy to destination document use that wrong style; if the correct page style had header/footer, then it would not be properly copied per record in single-document output; headers/footers would be wrong/absent. This change forces check of page descriptions after the work document had been created and initialized. Change-Id: Ic196eb7fac0241f002eddd2c1d1b66dfb489bc60 Reviewed-on: https://gerrit.libreoffice.org/65383 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit ec928ac5d84273b4bc1f923c545834dc59d3e394) Reviewed-on: https://gerrit.libreoffice.org/65407 Tested-by: Jenkins Tested-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 156219bb440b..bb3c5c97b7bb 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1502,6 +1502,15 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
// ExpFields update during printing, generation of preview, etc.
pWorkShell->LockExpFields();
pWorkShell->CalcLayout();
+ // tdf#121168: Now force correct page descriptions applied to page frames. Without
+ // this, e.g., page frames starting with sections could have page descriptions set
+ // wrong. This would lead to wrong page styles applied in SwDoc::AppendDoc below.
+ pWorkShell->GetViewOptions()->SetIdle(true);
+ for (auto aLayout : pWorkShell->GetDoc()->GetAllLayouts())
+ {
+ aLayout->FreezeLayout(false);
+ aLayout->AllCheckPageDescs();
+ }
}
lcl_emitEvent(SfxEventHintId::SwEventFieldMerge, STR_SW_EVENT_FIELD_MERGE, xWorkDocSh);