diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-17 17:01:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-03-17 17:59:14 +0100 |
commit | f4dd9ecdc21696b360dedf7fefa371c8858c1830 (patch) | |
tree | 81c337df4fda8a6058694be90687732cc61e6f11 /i18npool/source | |
parent | 0b5bf474d873fce11cc0f78d73f7e9656c95ffe8 (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/source')
-rw-r--r-- | i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 890855538881..86b64a3d23ad 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -553,11 +553,11 @@ bool should_ignore( const OUString& s ) } /** - * Turn nNumber into a string and pad the result to 2 using zero characters. + * Turn nNumber into a string and pad the result to nLimit by inserting zero characters at the + * start. */ -static OUString lcl_formatArabicZero(sal_Int32 nNumber) +static OUString lcl_formatArabicZero(sal_Int32 nNumber, sal_Int32 nLimit) { - sal_Int32 nLimit = 2; OUString aRet = OUString::number(nNumber); sal_Int32 nDiff = nLimit - aRet.getLength(); @@ -938,7 +938,11 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal break; case ARABIC_ZERO: - result += lcl_formatArabicZero(number); + result += lcl_formatArabicZero(number, 2); + break; + + case ARABIC_ZERO3: + result += lcl_formatArabicZero(number, 3); break; default: |