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 /vcl/source | |
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 'vcl/source')
-rw-r--r-- | vcl/source/app/i18nhelp.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 2 |
4 files changed, 10 insertions, 12 deletions
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx index 6e63220ff4e9..0448bc7be075 100644 --- a/vcl/source/app/i18nhelp.cxx +++ b/vcl/source/app/i18nhelp.cxx @@ -33,9 +33,9 @@ using namespace ::com::sun::star; -vcl::I18nHelper::I18nHelper( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMSF, const ::com::sun::star::lang::Locale& rLocale ) +vcl::I18nHelper::I18nHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::lang::Locale& rLocale ) { - mxMSF = rxMSF; + m_xContext = rxContext; maLocale = rLocale; mpLocaleDataWrapper = NULL; mpTransliterationWrapper= NULL; @@ -64,7 +64,7 @@ utl::TransliterationWrapper& vcl::I18nHelper::ImplGetTransliterationWrapper() co if ( mbTransliterateIgnoreCase ) nModules |= i18n::TransliterationModules_IGNORE_CASE; - ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( comphelper::getComponentContext(mxMSF), (i18n::TransliterationModules)nModules ); + ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( m_xContext, (i18n::TransliterationModules)nModules ); ((vcl::I18nHelper*)this)->mpTransliterationWrapper->loadModuleIfNeeded( MsLangId::convertLocaleToLanguage( maLocale ) ); } return *mpTransliterationWrapper; @@ -74,7 +74,7 @@ LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const { if ( !mpLocaleDataWrapper ) { - ((vcl::I18nHelper*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( mxMSF, maLocale ); + ((vcl::I18nHelper*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( m_xContext, maLocale ); } return *mpLocaleDataWrapper; } diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 29588d9a1316..72dc9066a6c7 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -1579,7 +1579,7 @@ LanguageType AllSettings::GetUILanguage() const const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const { if ( !mpData->mpLocaleDataWrapper ) - ((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() ); + ((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessComponentContext(), GetLocale() ); return *mpData->mpLocaleDataWrapper; } @@ -1588,7 +1588,7 @@ const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const { if ( !mpData->mpUILocaleDataWrapper ) - ((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetUILocale() ); + ((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessComponentContext(), GetUILocale() ); return *mpData->mpUILocaleDataWrapper; } @@ -1597,8 +1597,7 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const { if ( !mpData->mpI18nHelper ) { - ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(comphelper::getProcessServiceFactory()); - ((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper( aFactory, GetLocale() ); + ((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper( comphelper::getProcessComponentContext(), GetLocale() ); } return *mpData->mpI18nHelper; } @@ -1608,8 +1607,7 @@ const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const { if ( !mpData->mpUII18nHelper ) { - ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(comphelper::getProcessServiceFactory()); - ((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper( aFactory, GetUILocale() ); + ((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper( comphelper::getProcessComponentContext(), GetUILocale() ); } return *mpData->mpUII18nHelper; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index b410e5cde653..9600e447c9bb 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -309,7 +309,7 @@ LocaleDataWrapper& FormatterBase::ImplGetLocaleDataWrapper() const { if ( !mpLocaleDataWrapper ) { - ((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() ); + ((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( GetLocale() ); } return *mpLocaleDataWrapper; } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 41be7a3a1eb5..b719b7eed54f 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2970,7 +2970,7 @@ void TextEngine::SetLocale( const ::com::sun::star::lang::Locale& rLocale ) LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper() { if ( !mpLocaleDataWrapper ) - mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() ); + mpLocaleDataWrapper = new LocaleDataWrapper( GetLocale() ); return mpLocaleDataWrapper; } |