summaryrefslogtreecommitdiff
path: root/i18npool/source/nativenumber/nativenumbersupplier.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-05-30 17:28:17 +0200
committerEike Rathke <erack@redhat.com>2018-06-11 22:59:23 +0200
commitecad621f6889e8af23baa4faee62d10f580ec074 (patch)
treeadcc0b02a45ebb26c5a2351566acc67e26018c55 /i18npool/source/nativenumber/nativenumbersupplier.cxx
parent90385c35cc6bea312eedeea2de33529e76cd6f2a (diff)
tdf#115007: add import/export to NatNum12 (spell out numbers,
dates and money amounts, supporting all the XNumberText/libnumbertext formatting codes, for example "ordinal", "ordinal-number", "ordinal-feminine", etc., and ISO 4217 currency codes, also their possible combinations. NatNum12 formatting codes are stored by using the newly introduced (yet, loext:)transliteration-spellout attribute. creator-initials also added to token list Change-Id: I20f93c9d16778f142067a56d53b336d0acbe2d92 Reviewed-on: https://gerrit.libreoffice.org/54673 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 32f1c56d8ff5e6f87dbcf086fd3743d6d36182bc) Reviewed-on: https://gerrit.libreoffice.org/55625 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'i18npool/source/nativenumber/nativenumbersupplier.cxx')
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 0de111165adc..a18d8c7c798a 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -598,9 +598,10 @@ OUString getNumberText(const Locale& rLocale, const OUString& rNumberString,
static auto xNumberText
= css::linguistic2::NumberText::create(comphelper::getProcessComponentContext());
- OUString numbertext_prefix = sNumberTextParams;
- if (!numbertext_prefix.isEmpty())
- numbertext_prefix += " ";
+ OUString numbertext_prefix;
+ // default "cardinal" gets empty prefix
+ if (sNumberTextParams != "cardinal")
+ numbertext_prefix = sNumberTextParams + " ";
// Several hundreds of headings could result typing lags because
// of the continuous update of the multiple number names during typing.
// We fix this by buffering the result of the conversion.
@@ -777,7 +778,7 @@ sal_Bool SAL_CALL NativeNumberSupplierService::isValidNatNum( const Locale& rLoc
switch (nNativeNumberMode) {
case NativeNumberMode::NATNUM0: // Ascii
case NativeNumberMode::NATNUM3: // Char, FullWidth
- case NativeNumberMode::NATNUM12: // Spell number
+ case NativeNumberMode::NATNUM12: // spell out numbers, dates and money amounts
return true;
case NativeNumberMode::NATNUM1: // Char, Lower
return (langnum >= 0);