diff --git a/sw/qa/extras/ooxmlexport/data/tdf171025_pageAfter.docx b/sw/qa/extras/ooxmlexport/data/tdf171025_pageAfter.docx new file mode 100644 index 000000000000..ff6a768000a1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf171025_pageAfter.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx index a18288e0e137..ddac9aa94ec8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx @@ -41,6 +41,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148057_columnBreak, "tdf148057_columnBreak.docx" CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_OOXMLEXPORT_TEST(testTdf171025_pageAfter, "tdf171025_pageAfter.docx") +{ + // given a document with a LO specialty pageAfter break + // coupled with IsPlausableSingleWordSection + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf171038_pageAfter) { // given a document with a LO-specialty PageAfter break diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4589ee750553..febe11d813ac 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7218,7 +7218,7 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, bool bBreakAfter, const WW m_nColBreakStatus = COLBRK_POSTPONE; break; case msword::PageBreak: - if ( pSectionInfo ) + if (pSectionInfo && !m_bOpenedParaPr) { // Detect when the current node is the last node in the // document: the last section is written explicitly in @@ -7280,7 +7280,7 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, bool bBreakAfter, const WW } else if ( m_bParagraphOpened ) { - if (bBreakAfter) + if (bBreakAfter || m_bOpenedParaPr) // tdf#128889 m_bPageBreakAfter = true; else