summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2018-12-03 21:16:27 +0100
committerMiklos Vajna <vmiklos@collabora.com>2018-12-04 09:07:25 +0100
commitdc8a82488d4a8e5192d3cde43c10965fa89adf3d (patch)
tree51b5e0452a0db33b07e79f9ede576b0302d460c0
parent3915570a7e245283e97a8ab349247ee7d056c7c6 (diff)
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@collabora.com>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf121664.docxbin0 -> 12709 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx10
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx2
3 files changed, 11 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf121664.docx
Binary files 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 )