diff options
author | Justin Luth <justin_luth@sil.org> | 2018-10-27 17:04:02 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-10-29 04:33:13 +0100 |
commit | cb7500ddb8de6c41fca84a0009ffe22240bb1845 (patch) | |
tree | 9cda81459fe38a4646f4b5eb2017d1a116f00ab0 /sw | |
parent | 59d48c531a5cad27f02b91c9b86278d5ede211a1 (diff) |
tdf#108954 docxexport: only emit section if diff from current
For the very last paragraph, if a header or footer was defined in
the section, then a dummy section was always being added, but that
should only happen if the section is different from the current one.
If they are the same, then the pageDesc will be created anyway, so
a dummy isn't needed to prevent it from getting lost.
Change-Id: I5e3a53e2810622c7232aa23575740bd775c5a595
Reviewed-on: https://gerrit.libreoffice.org/62430
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 040b4e4766ff..f460e384fd53 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -586,6 +586,8 @@ DECLARE_OOXMLEXPORT_TEST(testN780843b, "n780843b.docx") uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(aStyleName), uno::UNO_QUERY); uno::Reference<text::XTextRange> xFooterText = getProperty< uno::Reference<text::XTextRange> >(xPageStyle, "FooterText"); CPPUNIT_ASSERT_EQUAL( OUString("hidden footer"), xFooterText->getString() ); + + CPPUNIT_ASSERT_EQUAL( 7, getParagraphs() ); } DECLARE_OOXMLEXPORT_TEST(testShadow, "imgshadow.docx") diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b5a75c2e8be4..fb94a73eaa4e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5843,7 +5843,8 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectio // footer, otherwise we go with the properties of the // section (and not the page style), which never has // headers/footers. - if (const SwPageDesc* pPageDesc = pSectionInfo->pPageDesc) + const SwPageDesc* pPageDesc = pSectionInfo->pPageDesc; + if ( pPageDesc && pPageDesc != m_rExport.m_pCurrentPageDesc ) { const auto& rMaster = pPageDesc->GetMaster(); bEmit = rMaster.GetHeader().IsActive() || rMaster.GetFooter().IsActive(); |