diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2022-02-09 09:41:51 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-02-11 01:16:05 +0100 |
commit | 96e1be11540bada172fbdbfbbe3f9b7dc3e58462 (patch) | |
tree | ece2755f8b7a326124a820f332d32438360ab58d /sw/qa/extras | |
parent | 35b9e7f90ca3751d474efff7745582b4bff3e2df (diff) |
tdf#146917: docx import: better support for style with num reset
When paragraph style is disabling numbering defined in parent
style we should apply margin properties (like we already do
in other numbering cases), but we should include only properties
from styles not affected by numbering. In other words, only
styles without w:numId are used.
Unittest was extended to cover different combinations of this
situation.
Change-Id: Ic19e00fcfe16b2357cdfe763b4f969cc63122e89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129701
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf132752.docx | bin | 34704 -> 26741 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 32 |
2 files changed, 29 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf132752.docx b/sw/qa/extras/ooxmlexport/data/tdf132752.docx Binary files differindex 57eddc455fca..a94fc498a101 100644 --- a/sw/qa/extras/ooxmlexport/data/tdf132752.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf132752.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 7ef35d1ac2a6..7fe132b69e68 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -382,9 +382,35 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143692_outlineLevelTortureTest, "tdf143692_outli DECLARE_OOXMLEXPORT_TEST(testTdf132752, "tdf132752.docx") { - CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(getParagraph(1), "ParaRightMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); + uno::Reference<beans::XPropertySet> xPara1(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(xPara1, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xPara1, "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara1, "ParaFirstLineIndent")); + + uno::Reference<beans::XPropertySet> xPara2(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(xPara2, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xPara2, "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-630), getProperty<sal_Int32>(xPara2, "ParaFirstLineIndent")); + + uno::Reference<beans::XPropertySet> xPara3(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara3, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5891), getProperty<sal_Int32>(xPara3, "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara3, "ParaFirstLineIndent")); + + uno::Reference<beans::XPropertySet> xPara4(getParagraph(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(xPara4, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xPara4, "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4157), getProperty<sal_Int32>(xPara4, "ParaFirstLineIndent")); + + uno::Reference<beans::XPropertySet> xPara5(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(xPara5, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xPara5, "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-630), getProperty<sal_Int32>(xPara5, "ParaFirstLineIndent")); + + uno::Reference<beans::XPropertySet> xPara6(getParagraph(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3565), getProperty<sal_Int32>(xPara6, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2764), getProperty<sal_Int32>(xPara6, "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-2394), getProperty<sal_Int32>(xPara6, "ParaFirstLineIndent")); } DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx") |