1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <sal/log.hxx>
23 #include <unotools/nativenumberwrapper.hxx>
24 #include <com/sun/star/i18n/NativeNumberSupplier.hpp>
26 using namespace ::com::sun::star
;
28 NativeNumberWrapper::NativeNumberWrapper(
29 const uno::Reference
< uno::XComponentContext
> & rxContext
32 xNNS
= i18n::NativeNumberSupplier::create(rxContext
);
35 NativeNumberWrapper::~NativeNumberWrapper()
40 NativeNumberWrapper::getNativeNumberString(
41 const OUString
& rNumberString
,
42 const ::com::sun::star::lang::Locale
& rLocale
,
43 sal_Int16 nNativeNumberMode
) const
48 return xNNS
->getNativeNumberString( rNumberString
, rLocale
, nNativeNumberMode
);
50 catch ( const uno::Exception
& )
52 SAL_WARN( "unotools.i18n", "getNativeNumberString: Exception caught!" );
57 i18n::NativeNumberXmlAttributes
58 NativeNumberWrapper::convertToXmlAttributes(
59 const ::com::sun::star::lang::Locale
& rLocale
,
60 sal_Int16 nNativeNumberMode
) const
65 return xNNS
->convertToXmlAttributes( rLocale
, nNativeNumberMode
);
67 catch ( const uno::Exception
& )
69 SAL_WARN( "unotools.i18n", "convertToXmlAttributes: Exception caught!" );
71 return i18n::NativeNumberXmlAttributes();
75 NativeNumberWrapper::convertFromXmlAttributes(
76 const i18n::NativeNumberXmlAttributes
& rAttr
) const
81 return xNNS
->convertFromXmlAttributes( rAttr
);
83 catch ( const uno::Exception
& )
85 SAL_WARN( "unotools.i18n", "convertFromXmlAttributes: Exception caught!" );
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */