summaryrefslogtreecommitdiff
path: root/i18npool/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-17 17:01:05 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-03-17 17:59:14 +0100
commitf4dd9ecdc21696b360dedf7fefa371c8858c1830 (patch)
tree81c337df4fda8a6058694be90687732cc61e6f11 /i18npool/qa
parent0b5bf474d873fce11cc0f78d73f7e9656c95ffe8 (diff)
sw pad-to-3 numbering: add doc model, UNO API and layout
This is similar to the existing padded numbering, but that one padded to 2. Another difference is pad-to-2 has more file format support: pad-to-3 is not supported in DOC and RTF. Change-Id: Ie2ac2691c58a89e181d24d7002cf873ebab380c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90656 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 daa464c9ac74..fee8df329520 100644
--- a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
+++ b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
@@ -48,6 +48,32 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero)
CPPUNIT_ASSERT_EQUAL(OUString("10"), aActual);
}
+CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero3)
+{
+ // 10 -> "010"
+ 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_ZERO3)),
+ comphelper::makePropertyValue("Value", static_cast<sal_Int32>(10)),
+ };
+ 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_ZERO3 was missing.
+ CPPUNIT_ASSERT_EQUAL(OUString("010"), aActual);
+
+ // 100 -> "100"
+ aProperties = {
+ comphelper::makePropertyValue("NumberingType",
+ static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO3)),
+ comphelper::makePropertyValue("Value", static_cast<sal_Int32>(100)),
+ };
+ aActual = xFormatter->makeNumberingString(aProperties, aLocale);
+ CPPUNIT_ASSERT_EQUAL(OUString("100"), aActual);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */