From d2f6a87ac7adb3f60f7eae7c5a8f8a9076b7a75c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 5 Nov 2012 11:28:43 +0200 Subject: 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 --- cui/source/dialogs/postdlg.cxx | 6 +++--- cui/source/options/optasian.cxx | 3 +-- cui/source/options/optgdlg.cxx | 4 ++-- cui/source/tabpages/tabstpge.cxx | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'cui') diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx index 4d2ecd1ce329..45971a7ae668 100644 --- a/cui/source/dialogs/postdlg.cxx +++ b/cui/source/dialogs/postdlg.cxx @@ -124,7 +124,7 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent, } else { - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); + LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() ); aDateStr = aLocaleWrapper.getDate( Date( Date::SYSTEM ) ); } @@ -212,7 +212,7 @@ IMPL_LINK_NOARG(SvxPostItDialog, Stamp) Date aDate( Date::SYSTEM ); Time aTime( Time::SYSTEM ); String aTmp( SvtUserOptions().GetID() ); - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); + LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() ); String aStr( aEditED.GetText() ); aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\n---- " ) ); @@ -239,7 +239,7 @@ IMPL_LINK_NOARG(SvxPostItDialog, Stamp) IMPL_LINK_NOARG(SvxPostItDialog, OKHdl) { - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); + LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() ); pOutSet = new SfxItemSet( rSet ); pOutSet->Put( SvxPostItAuthorItem( SvtUserOptions().GetID(), rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR ) ) ); diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 229af974baf2..20a6794835b3 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -349,8 +349,7 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl) } if(!bAvail) { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - LocaleDataWrapper aWrap( xMSF, aLocale ); + LocaleDataWrapper aWrap( aLocale ); ForbiddenCharacters aForbidden = aWrap.getForbiddenCharacters(); sStart = aForbidden.beginLine; sEnd = aForbidden.endLine; diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 84a8d3e51f9a..006be93a1c19 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1697,7 +1697,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) { Locale aTempLocale; SvxLanguageToLocale( aTempLocale, Application::GetSettings().GetLanguage()); - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale ); + LocaleDataWrapper aLocaleWrapper( aTempLocale ); aDatePatternsString = lcl_getDatePatternsConfigString( aLocaleWrapper); } aDatePatternsED.SetText( aDatePatternsString); @@ -1894,7 +1894,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) // obtain corresponding locale data Locale aTempLocale; SvxLanguageToLocale( aTempLocale, eLang ); - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale ); + LocaleDataWrapper aLocaleWrapper( aTempLocale ); // update the decimal separator key of the related CheckBox String sTempLabel(sDecimalSeparatorLabel); diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index d5f1a5c6fbe1..d01d497106da 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -186,7 +186,7 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent, aFillChar.SetAccessibleRelationLabeledBy(&aFillSpecial); // Get the default decimal char from the system - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); + LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() ); aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep()[0]; FreeResource(); } -- cgit