diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-09-23 22:26:46 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-06 15:07:07 +0100 |
commit | f0a495a56489b781177be8ff28c4660214c9bdf2 (patch) | |
tree | 1c86f71174334ab10605b550e18a292bbf90714a /sw/source/filter | |
parent | e40d28d65222ba462c20ede17da5ef54751932e3 (diff) |
tdf#136952 ww8export: always check for breakAfter on last split
This patch primarily adds support for
covering the situation where a rare page-after break
exists on a split paragraph node.
This patch also adds one more aspect to the fixes for tdf#132149,
where a breakBefore wasn't evaluated with the correct CurrentPageDesc.
Change-Id: Ia548c611c1b7b6c66cb7a7c58be1705cd8c42b77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103275
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index a59a13fe4766..5b29f8d07a55 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2736,9 +2736,22 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) // only try to sectionBreak after a split para if the next node specifies a break if ( bNeedParaSplit ) { + m_pCurrentPageDesc = pNextSplitParaPageDesc; SwNodeIndex aNextIndex( rNode, 1 ); const SwTextNode* pNextNode = aNextIndex.GetNode().GetTextNode(); bCheckSectionBreak = pNextNode && !NoPageBreakSection( pNextNode->GetpSwAttrSet() ); + + if ( !bCheckSectionBreak ) + { + auto rBreak = ItemGet<SvxFormatBreakItem>(rNode.GetSwAttrSet(), RES_BREAK); + if ( rBreak.GetBreak() == SvxBreak::PageAfter ) + { + if ( pNextNode && pNextNode->FindPageDesc() != pNextSplitParaPageDesc ) + bCheckSectionBreak = true; + else + AttrOutput().SectionBreak(msword::PageBreak, /*bBreakAfter=*/true); + } + } } if ( bCheckSectionBreak ) |