diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-08-26 18:22:51 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2020-09-21 18:41:37 +0200 |
commit | d08bbf4a1b1a62ef1f52665f52ed8880792c64ef (patch) | |
tree | 847642aff4fc3ec239d15944510f8ff792ec7a1b /sw/source/filter/ww8/wrtw8nds.cxx | |
parent | f08ddf3d3df0ef12fef36e96ffe6f5b9a7fda9e3 (diff) |
tdf#132149 ww8export: always check for break at end of paragraph
Make sure to check if the next node has a page-break
at the end of a split paragraph.
Change-Id: Ib103d7b2f653f9ae5772ff536c041afb445903b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101344
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/source/filter/ww8/wrtw8nds.cxx')
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 87ff1d82c701..3e9b52d40516 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2723,10 +2723,20 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) assert(pNextPageDesc); PrepareNewPageDesc( rNode.GetpSwAttrSet(), rNode, nullptr , pNextPageDesc); } - else if (!bNeedParaSplit) + else { // else check if section break needed after the paragraph - AttrOutput().SectionBreaks(rNode); + bool bCheckSectionBreak = true; + // only try to sectionBreak after a split para if the next node specifies a break + if ( bNeedParaSplit ) + { + SwNodeIndex aNextIndex( rNode, 1 ); + const SwTextNode* pNextNode = aNextIndex.GetNode().GetTextNode(); + bCheckSectionBreak = pNextNode && !NoPageBreakSection( pNextNode->GetpSwAttrSet() ); + } + + if ( bCheckSectionBreak ) + AttrOutput().SectionBreaks(rNode); } AttrOutput().StartParagraphProperties(); |