[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa sw/source

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 5 10:49:50 UTC 2021


 sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt   |binary
 sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx                         |   22 ++++++++++
 sw/source/filter/ww8/wrtw8sty.cxx                                  |    6 +-
 4 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 9ac77703e1925f3f9a8414628e1dcbe32fc2f60f
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Fri Apr 12 09:31:28 2019 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Fri Mar 5 11:49:16 2021 +0100

    tdf#124678 DOCX export: always write title page in section props
    
    Even if page description is not set we should try to mark title
    page because chaining of two page styles can not work for continuous
    sections.
    
    Unittests were implemented previously and were taken from abandoned
    patch https://gerrit.libreoffice.org/c/core/+/70646
    
    Change-Id: I0b953d72d762f868735dc658f023d96944c9d308
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111757
    Tested-by: Jenkins
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111952

diff --git a/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt b/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt
new file mode 100644
index 000000000000..a694ff613633
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt b/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt
new file mode 100644
index 000000000000..cb14c8ea4df3
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 7ec5da49be9f..95a7cc43fb29 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1193,6 +1193,28 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD_DATABASE, "tdf67207.docx")
     CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.text.fieldmaster.DataBase.database.Sheet1.c1"), sValue);
 }
 
+// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same,
+// except:
+// - tdf124678_no_leading_paragraph.odt doesn't contain leading empty paragraph
+//   before the first section
+//
+DECLARE_OOXMLEXPORT_TEST(testTdf124678_case1, "tdf124678_no_leading_paragraph.odt")
+{
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt"));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt"));
+}
+
+// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same,
+// except:
+// - tdf124678_no_leading_paragraph.odt doesn't contain leading empty paragraph
+//   before the first section
+//
+DECLARE_OOXMLEXPORT_TEST(testTdf124678_case2, "tdf124678_with_leading_paragraph.odt")
+{
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt"));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index eb06b97195bb..8a315444a133 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1661,9 +1661,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
             }
         }
 
-        if( titlePage )
-            AttrOutput().SectionTitlePage();
-
         const SfxItemSet* pOldI = m_pISet;
 
         const SfxPoolItem* pItem;
@@ -1729,6 +1726,9 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
         }
     }
 
+    if (titlePage)
+        AttrOutput().SectionTitlePage();
+
     AttrOutput().SectionType( nBreakCode );
 
     if( rSepInfo.pPageDesc ) {


More information about the Libreoffice-commits mailing list