summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-03 15:54:19 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-03-03 18:38:25 +0100
commit7a8450c3ecf1a8000cb37981c981fdd55d196df4 (patch)
tree69be3af7675f16032b07c1b886bb291fa9bd8197 /sw/qa
parent657d8c3e323c7353ce6fa1170532cb6e33d4b74f (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). Change-Id: I5c5c7ee5bd61175afc3e682276e69344852106d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89891 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/odfexport/data/arabic-zero-numbering.odtbin0 -> 8730 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx13
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
new file mode 100644
index 000000000000..2a445b22748a
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/arabic-zero-numbering.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index c613bdaa94dd..a89e916a2749 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2344,5 +2344,18 @@ DECLARE_ODFEXPORT_TEST(tdf121658, "tdf121658.odt")
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle1, "ParaHyphenationNoCaps"));
}
+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: */