summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docxbin0 -> 18696 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
3 files changed, 8 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx b/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx
new file mode 100644
index 000000000000..dd5d323e5778
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 0be5f82136ed..49184bd1ade4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -50,6 +50,11 @@ DECLARE_SW_EXPORT_TEST(testFlyInFly, "ooo39250-1-min.rtf", nullptr, Test)
CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), uno::Reference<container::XNamed>(xAnchorFrame, uno::UNO_QUERY_THROW)->getName());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf125778_lostPageBreakTOX, "tdf125778_lostPageBreakTOX.docx")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() );
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf126994_lostPageBreak, "tdf126994_lostPageBreak.docx")
{
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index bd73cc4ab542..6fe0624e0305 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3100,8 +3100,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
SwNodeIndex aIdx( rSectionNode, 1 );
const SwNode& rNd = aIdx.GetNode();
- if ( !rNd.IsSectionNode() && !IsInTable()
- && rSection.GetType() != TOX_CONTENT_SECTION && rSection.GetType() != TOX_HEADER_SECTION) //No sections in table
+ if ( !rNd.IsSectionNode() && !IsInTable() ) //No sections in table
{
// if the first Node inside the section has an own
// PageDesc or PageBreak attribute, then don't write
@@ -3121,7 +3120,8 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
else
AttrOutput().SectionBreaks( rSectionNode );
- if ( !pSet )
+ const bool bInTOX = rSection.GetType() == TOX_CONTENT_SECTION || rSection.GetType() == TOX_HEADER_SECTION;
+ if ( !pSet && !bInTOX )
{
// new Section with no own PageDesc/-Break
// -> write follow section break;