diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-05 11:28:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-15 08:28:44 +0100 |
commit | d2f6a87ac7adb3f60f7eae7c5a8f8a9076b7a75c (patch) | |
tree | 0bcc19623fa6cda27b78df47c54192bd3e73ef41 /svl/inc | |
parent | 5837402fb1daa437d9a1a37edc9ede57319944f1 (diff) |
fdo#46808, use service constructor for i18n::NumberFormatMapper
Also create a utility constructor for LocaleDataWrapper, which
simplifies many of the calling sites.
Change-Id: Ic8510b51c4201fa17fc0620e18d3e258e43636ba
Diffstat (limited to 'svl/inc')
-rw-r--r-- | svl/inc/svl/ondemand.hxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx index 792eb0f58e22..f724cca95746 100644 --- a/svl/inc/svl/ondemand.hxx +++ b/svl/inc/svl/ondemand.hxx @@ -54,7 +54,7 @@ class OnDemandLocaleDataWrapper { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; SvtSysLocale aSysLocale; LanguageType eCurrentLanguage; LanguageType eLastAnyLanguage; @@ -75,7 +75,7 @@ public: eCurrentLanguage = LANGUAGE_SYSTEM; } OnDemandLocaleDataWrapper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ::com::sun::star::lang::Locale& rLocale, LanguageType eLang ) @@ -85,7 +85,7 @@ public: , bInitialized(false) { pSystem = aSysLocale.GetLocaleDataPtr(); - init( rxSMgr, rLocale, eLang ); + init( rxContext, rLocale, eLang ); } ~OnDemandLocaleDataWrapper() { @@ -98,12 +98,12 @@ public: bool is() const { return pCurrent != NULL; } void init( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ::com::sun::star::lang::Locale& rLocale, LanguageType eLang ) { - xSMgr = rxSMgr; + m_xContext = rxContext; changeLocale( rLocale, eLang ); bInitialized = true; } @@ -117,13 +117,13 @@ public: break; case LANGUAGE_ENGLISH_US : if ( !pEnglish ) - pEnglish = new LocaleDataWrapper( xSMgr, rLocale ); + pEnglish = new LocaleDataWrapper( m_xContext, rLocale ); pCurrent = pEnglish; break; default: if ( !pAny ) { - pAny = new LocaleDataWrapper( xSMgr, rLocale ); + pAny = new LocaleDataWrapper( m_xContext, rLocale ); eLastAnyLanguage = eLang; } else if ( eLastAnyLanguage != eLang ) @@ -143,7 +143,7 @@ public: { if ( !pAny ) { - pAny = new LocaleDataWrapper( xSMgr, pCurrent->getLocale() ); + pAny = new LocaleDataWrapper( m_xContext, pCurrent->getLocale() ); eLastAnyLanguage = eCurrentLanguage; } else if ( pCurrent != pAny ) @@ -240,7 +240,7 @@ public: */ class OnDemandTransliterationWrapper { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; LanguageType eLanguage; ::com::sun::star::i18n::TransliterationModules nType; mutable ::utl::TransliterationWrapper* pPtr; @@ -255,14 +255,14 @@ public: , bInitialized(false) {} OnDemandTransliterationWrapper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, LanguageType eLang, ::com::sun::star::i18n::TransliterationModules nTypeP ) : bValid(false) , bInitialized(false) { - init( rxSMgr, eLang, nTypeP ); + init( rxContext, eLang, nTypeP ); } ~OnDemandTransliterationWrapper() { @@ -274,12 +274,12 @@ public: bool is() const { return pPtr != NULL; } void init( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, LanguageType eLang, ::com::sun::star::i18n::TransliterationModules nTypeP ) { - xSMgr = rxSMgr; + m_xContext = rxContext; nType = nTypeP; changeLocale( eLang ); if ( pPtr ) @@ -301,7 +301,7 @@ public: if ( !bValid ) { if ( !pPtr ) - pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType ); + pPtr = new ::utl::TransliterationWrapper( m_xContext, nType ); pPtr->loadModuleIfNeeded( eLanguage ); bValid = true; } @@ -311,7 +311,7 @@ public: const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const { if ( !pPtr ) - pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType ); + pPtr = new ::utl::TransliterationWrapper( m_xContext, nType ); pPtr->loadModuleByImplName( rModule, eLang ); bValid = false; // reforce settings change in get() return pPtr; |