diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-04-13 20:14:14 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-04-17 17:39:05 +0200 |
commit | 803b49a3776c98e2d435c328d39d0f71d259d9e5 (patch) | |
tree | 166a77ceb162bcccdfef897250bc68da1038e640 /sw | |
parent | 9152aed7804b65f6241cf35d85afcb50486a27ef (diff) |
tdf#79553 ww8import: line numbering distance is auto, not zero
sprmSDxaLnn:
An XAS_nonNeg that specifies the distance between line numbers and
the lines of text to which they apply. A value of 0 indicates that the
application MUST automatically determine positioning.
By default, the positioning of line numbers is automatically determined.
Change-Id: I35a440a7fa84f315f4a67e201e1a0066d4e4cf73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92126
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc | bin | 0 -> 77312 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 4 |
3 files changed, 19 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc b/sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc Binary files differnew file mode 100644 index 000000000000..260f5ce18ba0 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index d12eef55f6bd..87bc1787e991 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -126,6 +126,22 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testChicagoNumberingFootnote) CPPUNIT_ASSERT_EQUAL(nExpected, nActual); } +DECLARE_WW8EXPORT_TEST(testdf79553_lineNumbers, "tdf79553_lineNumbers.doc") +{ + bool bValue = false; + sal_Int32 nValue = -1; + + uno::Reference< text::XTextDocument > xtextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference< text::XLineNumberingProperties > xLineProperties( xtextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPropertySet = xLineProperties->getLineNumberingProperties(); + + xPropertySet->getPropertyValue("IsOn") >>= bValue; + CPPUNIT_ASSERT_EQUAL(true, bValue); + + xPropertySet->getPropertyValue("Distance") >>= nValue; + CPPUNIT_ASSERT_MESSAGE("automatic distance", nValue > 0); +} + DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc") { uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles"); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 15b3cca4ca34..47545c6e9166 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -767,7 +767,9 @@ void SwWW8ImplReader::HandleLineNumbering(const wwSection &rSection) aInfo.SetRestartEachPage(rSection.maSep.lnc == 0); - aInfo.SetPosFromLeft(writer_cast<sal_uInt16>(rSection.maSep.dxaLnn)); + // A value of 0 (auto) indicates that the application MUST automatically determine positioning. + if ( rSection.maSep.dxaLnn ) + aInfo.SetPosFromLeft(writer_cast<sal_uInt16>(rSection.maSep.dxaLnn)); //Paint only for every n line aInfo.SetCountBy(rSection.maSep.nLnnMod); |