summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-05-13 03:09:43 +0300
committerEike Rathke <erack@redhat.com>2018-06-11 22:59:12 +0200
commit90385c35cc6bea312eedeea2de33529e76cd6f2a (patch)
tree8770c7c27d5776c2c98bf96626d32130c9c27eaa /unotools
parent3aa6a43a59ea940fa079231b0a0251d7bbd05f85 (diff)
tdf#115007: Use [NatNum12 params...] syntax
This allows using all the libnumbertext library functions. [NatNum12] gives cardinal number names (one, two, three, ...) [NatNum12 ordinal] gives ordinal number names (first, second, third, ...) [NatNum12 ordinal-number] gives ordinal indicators (1st, 2nd, 3rd, ...) [NatNum12 money USD][$-409] gives formal English (US) money text ... etc (see numbertext.org for syntax). Change-Id: I16dbb44d8d4bdb82a1b950de6d438c8311b554ff Reviewed-on: https://gerrit.libreoffice.org/54366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 90d233b0311a208967a3e264820e00395bf057fb) Reviewed-on: https://gerrit.libreoffice.org/55624 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/i18n/nativenumberwrapper.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/unotools/source/i18n/nativenumberwrapper.cxx b/unotools/source/i18n/nativenumberwrapper.cxx
index 102e765d4275..26fcbd7fa32f 100644
--- a/unotools/source/i18n/nativenumberwrapper.cxx
+++ b/unotools/source/i18n/nativenumberwrapper.cxx
@@ -21,7 +21,7 @@
#include <sal/log.hxx>
#include <unotools/nativenumberwrapper.hxx>
-#include <com/sun/star/i18n/NativeNumberSupplier.hpp>
+#include <com/sun/star/i18n/NativeNumberSupplier2.hpp>
using namespace ::com::sun::star;
@@ -29,7 +29,7 @@ NativeNumberWrapper::NativeNumberWrapper(
const uno::Reference< uno::XComponentContext > & rxContext
)
{
- xNNS = i18n::NativeNumberSupplier::create(rxContext);
+ xNNS = i18n::NativeNumberSupplier2::create(rxContext);
}
NativeNumberWrapper::~NativeNumberWrapper()
@@ -40,12 +40,12 @@ OUString
NativeNumberWrapper::getNativeNumberString(
const OUString& rNumberString,
const css::lang::Locale& rLocale,
- sal_Int16 nNativeNumberMode ) const
+ sal_Int16 nNativeNumberMode) const
{
try
{
if ( xNNS.is() )
- return xNNS->getNativeNumberString( rNumberString, rLocale, nNativeNumberMode );
+ return xNNS->getNativeNumberString(rNumberString, rLocale, nNativeNumberMode);
}
catch ( const uno::Exception& )
{
@@ -54,6 +54,26 @@ NativeNumberWrapper::getNativeNumberString(
return OUString();
}
+OUString
+NativeNumberWrapper::getNativeNumberStringParams(
+ const OUString& rNumberString,
+ const css::lang::Locale& rLocale,
+ sal_Int16 nNativeNumberMode,
+ const OUString& rNativeNumberParams) const
+{
+ try
+ {
+ if ( xNNS.is() )
+ return xNNS->getNativeNumberStringParams(rNumberString, rLocale, nNativeNumberMode,
+ rNativeNumberParams);
+ }
+ catch ( const uno::Exception& )
+ {
+ SAL_WARN( "unotools.i18n", "getNativeNumberStringParams: Exception caught!" );
+ }
+ return OUString();
+}
+
i18n::NativeNumberXmlAttributes
NativeNumberWrapper::convertToXmlAttributes(
const css::lang::Locale& rLocale,