From e001e8a24c71cf2bdb455acb5bf54ac685bc1df7 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 8 Jul 2020 10:25:34 +0200 Subject: tdf#134260: sw: Add unittest Change-Id: I719dac8528453b00219c5bdc621f7ce88cd40bde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98318 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sw/qa/extras/ooxmlexport/data/tdf134260.docx | Bin 0 -> 14233 bytes sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 31 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf134260.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/tdf134260.docx b/sw/qa/extras/ooxmlexport/data/tdf134260.docx new file mode 100644 index 000000000000..98c4107f4804 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf134260.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 3ca1a456182f..f2e09af96bfa 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -267,6 +267,37 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133000_numStyleFormatting, "tdf133000_numStyleFo CPPUNIT_ASSERT( nLevel1Margin < nLevel2Margin ); } +DECLARE_OOXMLEXPORT_TEST(testTdf134260, "tdf134260.docx") +{ + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 0 + // - Actual : 1270 + + auto xNum1Levels + = getProperty>(getParagraph(1), "NumberingRules"); + + CPPUNIT_ASSERT_EQUAL( + sal_Int32(0), + comphelper::SequenceAsHashMap(xNum1Levels->getByIndex(0))["ListtabStopPosition"] + .get()); + + auto xNum2Levels + = getProperty>(getParagraph(2), "NumberingRules"); + + CPPUNIT_ASSERT_EQUAL( + sal_Int32(0), + comphelper::SequenceAsHashMap(xNum2Levels->getByIndex(0))["ListtabStopPosition"] + .get()); + + auto xNum3Levels + = getProperty>(getParagraph(3), "NumberingRules"); + + CPPUNIT_ASSERT_EQUAL( + sal_Int32(0), + comphelper::SequenceAsHashMap(xNum3Levels->getByIndex(0))["ListtabStopPosition"] + .get()); +} + DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.docx") { auto xNumberingRules -- cgit