From c2bbc9797c2fef9078c11460100996972bebd971 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 5 Nov 2012 15:07:20 +0200 Subject: fdo#46808, use service constructor for i18n::NativeNumberSupplier Change-Id: I092ca8f912e26f0743909920c6e740d648b8677e --- unotools/inc/unotools/nativenumberwrapper.hxx | 7 +++---- unotools/source/i18n/nativenumberwrapper.cxx | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'unotools') diff --git a/unotools/inc/unotools/nativenumberwrapper.hxx b/unotools/inc/unotools/nativenumberwrapper.hxx index b8bac89a7cc0..dea1ee01e0f7 100644 --- a/unotools/inc/unotools/nativenumberwrapper.hxx +++ b/unotools/inc/unotools/nativenumberwrapper.hxx @@ -23,15 +23,14 @@ #include namespace com { namespace sun { namespace star { - namespace lang { - class XMultiServiceFactory; + namespace uno { + class XComponentContext; } }}} class UNOTOOLS_DLLPUBLIC NativeNumberWrapper { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XNativeNumberSupplier > xNNS; // not implemented, prevent usage NativeNumberWrapper( const NativeNumberWrapper& ); @@ -39,7 +38,7 @@ class UNOTOOLS_DLLPUBLIC NativeNumberWrapper public: NativeNumberWrapper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext ); ~NativeNumberWrapper(); diff --git a/unotools/source/i18n/nativenumberwrapper.cxx b/unotools/source/i18n/nativenumberwrapper.cxx index 5fa8f0a0b943..59238084f695 100644 --- a/unotools/source/i18n/nativenumberwrapper.cxx +++ b/unotools/source/i18n/nativenumberwrapper.cxx @@ -20,20 +20,15 @@ #include #include -#include "instance.hxx" +#include using namespace ::com::sun::star; NativeNumberWrapper::NativeNumberWrapper( - const uno::Reference< lang::XMultiServiceFactory > & xSF + const uno::Reference< uno::XComponentContext > & rxContext ) - : - xSMgr( xSF ) { - xNNS = uno::Reference< i18n::XNativeNumberSupplier > ( - intl_createInstance( xSMgr, "com.sun.star.i18n.NativeNumberSupplier", - "NativeNumberWrapper"), uno::UNO_QUERY ); - DBG_ASSERT( xNNS.is(), "NativeNumberWrapper: no NativeNumberSupplier" ); + xNNS = i18n::NativeNumberSupplier::create(rxContext); } -- cgit