diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-29 09:32:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-03 15:55:06 +0200 |
commit | 3a36408b73d8a9be43cd9f4570537ff1d80c0114 (patch) | |
tree | f46fe36878b77836f9ef3606e162e87ab84bdcb2 /chart2 | |
parent | bc00717bb7a2b48885ca356fb0a966acbe72dca9 (diff) |
fdo#46808, Adapt util::NumberFormatter UNO service to new style
Create a merged XNumberFormatter2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: I57f35cde0a9dbbe91c1d2c3d068cb3a97c7245e3
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/tools/RegressionCurveCalculator.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx index d19276d17f76..b64b02cb55aa 100644 --- a/chart2/source/tools/RegressionCurveCalculator.cxx +++ b/chart2/source/tools/RegressionCurveCalculator.cxx @@ -26,6 +26,7 @@ #include <rtl/math.hxx> #include <com/sun/star/lang/XServiceName.hpp> +#include <com/sun/star/util/NumberFormatter.hpp> using namespace ::com::sun::star; @@ -140,13 +141,8 @@ OUString SAL_CALL RegressionCurveCalculator::getFormattedRepresentation( // create and prepare a number formatter if( !xNumFmtSupplier.is()) return getRepresentation(); - Reference< util::XNumberFormatter > xNumFormatter; - Reference< lang::XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); - if( xFact.is()) - xNumFormatter.set( xFact->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter"))), uno::UNO_QUERY ); - if( !xNumFormatter.is()) - return getRepresentation(); + Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext(), uno::UNO_QUERY_THROW ); + Reference< util::XNumberFormatter > xNumFormatter( util::NumberFormatter::create(xContext), uno::UNO_QUERY_THROW ); xNumFormatter->attachNumberFormatsSupplier( xNumFmtSupplier ); return ImplGetRepresentation( xNumFormatter, nNumberFormatKey ); |