[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 17 15:39:43 UTC 2020
sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc |binary
sw/qa/extras/ww8export/ww8export3.cxx | 16 ++++++++++++++++
sw/source/filter/ww8/ww8par6.cxx | 4 +++-
3 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit 803b49a3776c98e2d435c328d39d0f71d259d9e5
Author: Justin Luth <justin.luth at collabora.com>
AuthorDate: Mon Apr 13 20:14:14 2020 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Apr 17 17:39:05 2020 +0200
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 at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc b/sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc
new file mode 100644
index 000000000000..260f5ce18ba0
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf79553_lineNumbers.doc differ
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);
More information about the Libreoffice-commits
mailing list