diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-03 15:54:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-05-14 11:35:56 +0200 |
commit | 7f2fc930474ecc2237d2dc0170d0dddebf7932ba (patch) | |
tree | fd7be62e4c2ad5ed396f7ac9068516c3eee65a00 /sw | |
parent | 2a4e767ea83e49fafb639e66e74403c2ff9270ac (diff) |
sw padded numbering: add ODF filter
ODF allows any string as style:num-format="...", go with "01, 02, 03,
...", because that seems to be consistent with both
DefaultNumberingProvider::makeNumberingIdentifier()'s fallback mechanism
and with OOXML (which uses "001, 002, 003, ..." for the "pad to 3"
case).
(cherry picked from commit 7a8450c3ecf1a8000cb37981c981fdd55d196df4)
Conflicts:
sw/qa/extras/odfexport/odfexport.cxx
Change-Id: I5c5c7ee5bd61175afc3e682276e69344852106d5
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/data/arabic-zero-numbering.odt | bin | 0 -> 8730 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 13 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/arabic-zero-numbering.odt b/sw/qa/extras/odfexport/data/arabic-zero-numbering.odt Binary files differnew file mode 100644 index 000000000000..2a445b22748a --- /dev/null +++ b/sw/qa/extras/odfexport/data/arabic-zero-numbering.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index cd7ec96315f4..0d5c28f07ebd 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2335,5 +2335,18 @@ DECLARE_ODFEXPORT_TEST(testPageContentBottom, "page-content-bottom.odt") CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int16>(xShape, "VertOrientRelation")); } +DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.odt") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules"); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 64 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO), + aMap["NumberingType"].get<sal_uInt16>()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |