diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-02 15:13:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-05 18:05:00 +0100 |
commit | 0666e43c45876199ddc71e378554878cca6f0539 (patch) | |
tree | 39fd44bd26cceaa71a86a06c480d80c8351b5e0f /unotools | |
parent | ebc61e11cdb02f5cc33aeabead3d191eaf0d23d3 (diff) |
fdo#46808, use service constructor for i18n::CharacterClassification
Change-Id: I0499ad7de27b1539e97f01ab8aa0ef2d6713ae76
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/charclass.hxx | 7 | ||||
-rw-r--r-- | unotools/source/i18n/charclass.cxx | 14 | ||||
-rw-r--r-- | unotools/source/misc/syslocale.cxx | 2 |
3 files changed, 9 insertions, 14 deletions
diff --git a/unotools/inc/unotools/charclass.hxx b/unotools/inc/unotools/charclass.hxx index 5538e68f6351..744321091230 100644 --- a/unotools/inc/unotools/charclass.hxx +++ b/unotools/inc/unotools/charclass.hxx @@ -34,8 +34,8 @@ class String; namespace com { namespace sun { namespace star { - namespace lang { - class XMultiServiceFactory; + namespace uno { + class XComponentContext; } }}} @@ -70,13 +70,12 @@ class UNOTOOLS_DLLPUBLIC CharClass : private boost::noncopyable { ::com::sun::star::lang::Locale aLocale; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > xCC; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; mutable ::osl::Mutex aMutex; public: /// Preferred ctor with service manager specified CharClass( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext, const ::com::sun::star::lang::Locale& rLocale); /// Depricated ctor, tries to get a process service manager or to load the diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index 7a873abd566d..fa718cb119d3 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -18,13 +18,12 @@ */ +#include <comphelper/processfactory.hxx> #include <unotools/charclass.hxx> #include <tools/string.hxx> #include <tools/debug.hxx> -#include "instance.hxx" - -#define CHARCLASS_SERVICENAME "com.sun.star.i18n.CharacterClassification" +#include <com/sun/star/i18n/CharacterClassification.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::i18n; @@ -32,14 +31,12 @@ using namespace ::com::sun::star::uno; CharClass::CharClass( - const Reference< lang::XMultiServiceFactory > & xSF, + const Reference< uno::XComponentContext > & rxContext, const lang::Locale& rLocale ) - : - xSMgr( xSF ) { setLocale( rLocale ); - xCC = Reference< XCharacterClassification > ( intl_createInstance( xSMgr, CHARCLASS_SERVICENAME, "CharClass" ), uno::UNO_QUERY ); + xCC = CharacterClassification::create( rxContext ); } @@ -47,8 +44,7 @@ CharClass::CharClass( const ::com::sun::star::lang::Locale& rLocale ) { setLocale( rLocale ); - Reference< lang::XMultiServiceFactory > xNil; - xCC = Reference< XCharacterClassification > ( intl_createInstance( xNil, CHARCLASS_SERVICENAME, "CharClass" ), uno::UNO_QUERY ); + xCC = CharacterClassification::create( comphelper::getProcessComponentContext() ); } diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx index ead6e92eeb3e..43950737e4b5 100644 --- a/unotools/source/misc/syslocale.cxx +++ b/unotools/source/misc/syslocale.cxx @@ -75,7 +75,7 @@ SvtSysLocale_Impl::~SvtSysLocale_Impl() CharClass* SvtSysLocale_Impl::GetCharClass() { if ( !pCharClass ) - pCharClass = new CharClass(::comphelper::getProcessServiceFactory(), aSysLocaleOptions.GetRealLocale() ); + pCharClass = new CharClass( aSysLocaleOptions.GetRealLocale() ); return pCharClass; } |