[Libreoffice-commits] core.git: sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 03:33:35 UTC 2018


 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx    |    2 ++
 sw/source/filter/ww8/docxattributeoutput.cxx |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit cb7500ddb8de6c41fca84a0009ffe22240bb1845
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Sat Oct 27 17:04:02 2018 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Mon Oct 29 04:33:13 2018 +0100

    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 at sil.org>

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();


More information about the Libreoffice-commits mailing list