diff options
author | Justin Luth <justin_luth@sil.org> | 2018-01-23 14:41:48 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-25 13:39:17 +0100 |
commit | 8fd13c356d78fb72ba5dd288a495551f23e15363 (patch) | |
tree | dfd8ec1bc91edeccb24c0e251eabf47e382aca71 /sw/qa | |
parent | f82434b54517cad96416df93e9b5d70c9b0ada45 (diff) |
ooxmlimport: support inherited listid
This is prep work for tdf#95377. This unit test avoids the unique
chapter-numbering style (from the heading paragraph styles) and just
has a basic, user-created style inheriting from Default.
Also unique about this unit test is that the numbering is
specified by the "Default Style" which takes a rather unique
code path and exposes even more problems.
We already know the listId through a recursive function, and
GetCurrentNumberingRules only looks at the current style which
isn't good enough. Moved that modified function into
DomainMapper_Impl since I will need it there for bug 95377.
Additionally, ensure that directly applied paragraph properties
are not overwritten. That also meant changing the order, so that
paraStyle properties are directly applied to the paragraph before
applying RightMargin and friends.
Change-Id: I5c1fb71d64727be9d9105f287150daf4e0ff413d
Reviewed-on: https://gerrit.libreoffice.org/48457
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf95377.docx | bin | 0 -> 11982 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf95377.docx b/sw/qa/extras/ooxmlexport/data/tdf95377.docx Binary files differnew file mode 100644 index 000000000000..be5551dca282 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95377.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index e5af806f373b..9128303db319 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -907,6 +907,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92454, "tdf92454.docx") CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); } +DECLARE_OOXMLEXPORT_TEST(testTdf95377, "tdf95377.docx") +{ + uno::Reference<beans::XPropertyState> xParagraph(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xParagraph, "ParaRightMargin")); + + xParagraph.set(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-501), getProperty<sal_Int32>(xParagraph, "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); + + xParagraph.set(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-250), getProperty<sal_Int32>(xParagraph, "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf95376, "tdf95376.docx") { uno::Reference<beans::XPropertyState> xParagraph(getParagraph(2), uno::UNO_QUERY); |