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

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Sat Nov 9 14:58:50 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx                    |    5 +++++
 sw/source/filter/ww8/wrtw8nds.cxx                             |    6 +++---
 3 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit bb6edb9d28058a7bf6ba7faa9b371002e33331d8
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Mon Nov 4 08:14:41 2019 +0300
Commit:     Xisco FaulĂ­ <xiscofauli at libreoffice.org>
CommitDate: Sat Nov 9 15:57:48 2019 +0100

    tdf#125778 docxexport: handle pageBreak before TOX
    
    The pagebreak before the TOX was lost in docx
    (but not in .doc or .rtf).
    
    Change-Id: I280b0bd19a73db180b65a0937bd0fe809e5dfc6f
    Reviewed-on: https://gerrit.libreoffice.org/81979
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit 4ea43e887498f9d78f70b40bcdc53865057a78c0)
    Reviewed-on: https://gerrit.libreoffice.org/82250
    Reviewed-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>

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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf125778_lostPageBreakTOX.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 0fc73d0d2879..3800851c3b83 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(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 dc7e4e18c6e8..947e16457bf5 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3025,8 +3025,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
@@ -3046,7 +3045,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;


More information about the Libreoffice-commits mailing list