summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf134649_pageBreak.fodt86
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
3 files changed, 99 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf134649_pageBreak.fodt b/sw/qa/extras/ooxmlexport/data/tdf134649_pageBreak.fodt
new file mode 100644
index 000000000000..7d05c3e3ce99
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf134649_pageBreak.fodt
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+ <style:default-style style:family="paragraph">
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+ </style:style>
+ <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ </style:style>
+ <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ </style:style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Table1" style:family="table">
+ <style:table-properties style:width="11.509cm" table:align="left"/>
+ </style:style>
+ <style:style style:name="Table2" style:family="table" style:master-page-name="Landscape">
+ <style:table-properties style:page-number="auto" table:align="margins"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.59cm" fo:page-height="27.94cm" style:print-orientation="portrait"/>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties fo:page-height="21.59cm" fo:page-width="27.94cm" style:print-orientation="landscape"/>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ <style:master-page style:name="Landscape" style:page-layout-name="pm2"/>
+ </office:master-styles>
+ <office:body>
+ <office:text text:use-soft-page-breaks="true">
+ <text:p>Two tables, one pagebreak:</text:p>
+ <table:table table:name="Table1" table:style-name="Table1">
+ <table:table-column/>
+ <table:table-column/>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Hello1</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>World1</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <table:table table:name="Table2" table:style-name="Table2">
+ <table:table-column/>
+ <table:table-column/>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Hello2</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>World2</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p text:style-name="Table_20_Contents"/>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <text:p/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 397b9040e026..65004941acc6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -263,6 +263,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133370_columnBreak, "tdf133370_columnBreak.odt")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf134649_pageBreak, "tdf134649_pageBreak.fodt")
+{
+ // This was 1 (missing page break between tables).
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf135343_columnSectionBreak_c14, "tdf135343_columnSectionBreak_c14.docx")
{
uno::Reference<beans::XPropertySet> xTextSection = getProperty<uno::Reference<beans::XPropertySet>>(getParagraph(1), "TextSection");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4bd72ebf247a..6a1593d265e4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1027,6 +1027,13 @@ void DocxAttributeOutput::SectionBreaks(const SwNode& rNode)
if (rNode.StartOfSectionNode()->IsTableNode() || rNode.StartOfSectionNode()->IsSectionNode())
m_rExport.OutputSectionBreaks(pTextNode->GetpSwAttrSet(), *pTextNode, m_tableReference->m_bTableCellOpen);
}
+ else if (aNextIndex.GetNode().IsTableNode())
+ {
+ // Handle section break between tables.
+ const SwTableNode* pTableNode = static_cast<SwTableNode*>(&aNextIndex.GetNode());
+ const SwFrameFormat *pFormat = pTableNode->GetTable().GetFrameFormat();
+ m_rExport.OutputSectionBreaks(&(pFormat->GetAttrSet()), *pTableNode);
+ }
}
}