[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/qa sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 7 20:23:58 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx                 |    5 +++++
 sw/source/filter/ww8/wrtww8.cxx                            |    7 ++++---
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit fbd1914f6dfed752f4aee01302f49cbd0b0cd239
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Tue Sep 3 14:14:10 2019 +0300
Commit:     Xisco FaulĂ­ <xiscofauli at libreoffice.org>
CommitDate: Thu Nov 7 21:23:16 2019 +0100

    tdf#126994 ww8 export: Don't skip TOX end node
    
    The section end node processes the section page break,
    so skipping it after the Table Of Contents meant that a
    page break here was lost.
    
    This fix is specifically for DOCX although it could impact
    .doc (which already worked, and still does) and .rtf
    (which probably doesn't work with section end anyway).
    Utlimately, it just calls OutputEndNode() for an end node,
    so it shouldn't cause any difficulties.
    
    Change-Id: Iabc4a734365febb2b3e3bfed7d3c954b4b01da34
    Reviewed-on: https://gerrit.libreoffice.org/78552
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit 5d04e2c94c8b3f6c5e75ff4c394ca086de5a6e5a)
    Reviewed-on: https://gerrit.libreoffice.org/82223
    Reviewed-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx b/sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx
new file mode 100644
index 000000000000..9025ce652ebb
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf126994_lostPageBreak.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 8539548fc22c..0fc73d0d2879 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -46,6 +46,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(testTdf126994_lostPageBreak, "tdf126994_lostPageBreak.docx")
+{
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF, "tdf121374_sectionHF.odt")
 {
     uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index bf8fb4665528..91be4679ff4d 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2756,12 +2756,13 @@ void MSWordExportBase::WriteText()
                 ;
             else if ( aIdx.GetNode().IsSectionNode() )
                 ;
-            else if ( !IsInTable()
-                && (rSect.GetType() != TOX_CONTENT_SECTION && rSect.GetType() != TOX_HEADER_SECTION )) //No sections in table
+            else if ( !IsInTable() )    //No sections in table
             {
                 //#120140# Do not need to insert a page/section break after a section end. Check this case first
                 bool bNeedExportBreakHere = true;
-                if ( aIdx.GetNode().IsTextNode() )
+                if ( rSect.GetType() == TOX_CONTENT_SECTION || rSect.GetType() == TOX_HEADER_SECTION )
+                    bNeedExportBreakHere = false;
+                else if ( aIdx.GetNode().IsTextNode() )
                 {
                     SwTextNode *pTempNext = aIdx.GetNode().GetTextNode();
                     if ( pTempNext )


More information about the Libreoffice-commits mailing list