sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 4 ++-- sw/source/filter/ww8/wrtw8nds.cxx | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-)
New commits: commit d08bbf4a1b1a62ef1f52665f52ed8880792c64ef Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Wed Aug 26 18:22:51 2020 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Mon Sep 21 18:41:37 2020 +0200 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 <vmik...@collabora.com> Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 6606befccaf1..09f847b64b2a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -525,8 +525,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf132149_pgBreak, "tdf132149_pgBreak.odt") assertXPath(pDump, "//page[2]/header", 0); //Page break is not lost. This SHOULD be on page 4, but sadly it is not. - //assertXPathContent(pDump, "//page[5]/header", "First Page Style"); - //CPPUNIT_ASSERT(getXPathContent(pDump, "//page[5]/body/txt").startsWith("Lorem ipsum")); + assertXPathContent(pDump, "//page[5]/header/txt", "First Page Style"); + CPPUNIT_ASSERT(getXPathContent(pDump, "//page[5]/body/txt").startsWith("Lorem ipsum")); } DECLARE_OOXMLEXPORT_TEST(testTdf135949_anchoredBeforeBreak, "tdf135949_anchoredBeforeBreak.docx") 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits