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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 4 08:07:46 UTC 2018


 sw/qa/extras/ooxmlimport/data/tdf121664.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx    |   10 ++++++++++
 writerfilter/source/dmapper/PropertyMap.cxx  |    2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit dc8a82488d4a8e5192d3cde43c10965fa89adf3d
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Dec 3 21:16:27 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Dec 4 09:07:25 2018 +0100

    tdf#121664 DOCX import: fix lack of line numbering reset on page break
    
    Regression from commit d620629521aee48dc820b6970ca446c329d0b09a (Use
    constants for ST_LineNumberRestart values, 2014-10-01) where I forgot to
    adapt the constructor's initializer list to also use the new constants.
    
    Change-Id: I7113d23cceb3a00f0d466b63c99a18bf3dfd0ee3
    Reviewed-on: https://gerrit.libreoffice.org/64489
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf121664.docx b/sw/qa/extras/ooxmlimport/data/tdf121664.docx
new file mode 100644
index 000000000000..7ba8e86b58f1
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf121664.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 8466180c7903..877a645da288 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -51,6 +51,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf109053, "tdf109053.docx")
     CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf121664, "tdf121664.docx")
+{
+    uno::Reference<text::XLineNumberingProperties> xLineNumbering(mxComponent, uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xLineNumbering.is());
+    // Without the accompanying fix in place, numbering did not restart on the
+    // second page.
+    CPPUNIT_ASSERT(
+        getProperty<bool>(xLineNumbering->getLineNumberingProperties(), "RestartAtEachPage"));
+}
+
 DECLARE_OOXMLIMPORT_TEST(testTdf108849, "tdf108849.docx")
 {
     // sectPr element that is child element of body must be the last child. However, Word accepts it
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 46a875a9e8b9..ff81c20286d5 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -396,7 +396,7 @@ SectionPropertyMap::SectionPropertyMap( bool bIsFirstSection )
     , m_nDxtCharSpace( 0 )
     , m_bGridSnapToChars( true )
     , m_nLnnMod( 0 )
-    , m_nLnc( 0 )
+    , m_nLnc(NS_ooxml::LN_Value_ST_LineNumberRestart_newPage)
     , m_ndxaLnn( 0 )
     , m_nLnnMin( 0 )
     , m_bDefaultHeaderLinkToPrevious( true )


More information about the Libreoffice-commits mailing list