summaryrefslogtreecommitdiff
path: root/i18npool/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-23 13:37:25 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-03-23 14:32:37 +0100
commit8540c7b18bae9c9b46e6feb7658198a7fc62e811 (patch)
tree35743ff06a7f5e43bdfbaa5c136d0836cda26e28 /i18npool/qa
parentfecca49c309fc723c524f12fa671114b316a5562 (diff)
sw: add pad-to-5 numbering
This is the last padded numbering type that is supported by Word but was not supported by Writer. Change-Id: Ica1a0843897c61a4b569105fd21e5bfe7b5012cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90912 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'i18npool/qa')
-rw-r--r--i18npool/qa/cppunit/test_defaultnumberingprovider.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
index a74e92b7c432..dbe55050a01c 100644
--- a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
+++ b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
@@ -100,6 +100,32 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero4)
CPPUNIT_ASSERT_EQUAL(OUString("1000"), aActual);
}
+CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero5)
+{
+ // 1000 -> "01000"
+ uno::Reference<text::XNumberingFormatter> xFormatter(
+ text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProperties = {
+ comphelper::makePropertyValue("NumberingType",
+ static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO5)),
+ comphelper::makePropertyValue("Value", static_cast<sal_Int32>(1000)),
+ };
+ lang::Locale aLocale;
+ OUString aActual = xFormatter->makeNumberingString(aProperties, aLocale);
+ // Without the accompanying fix in place, this test would have failed with a
+ // lang.IllegalArgumentException, support for ARABIC_ZERO5 was missing.
+ CPPUNIT_ASSERT_EQUAL(OUString("01000"), aActual);
+
+ // 10000 -> "10000"
+ aProperties = {
+ comphelper::makePropertyValue("NumberingType",
+ static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO5)),
+ comphelper::makePropertyValue("Value", static_cast<sal_Int32>(10000)),
+ };
+ aActual = xFormatter->makeNumberingString(aProperties, aLocale);
+ CPPUNIT_ASSERT_EQUAL(OUString("10000"), aActual);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */