summaryrefslogtreecommitdiff
path: root/unotools/source/config
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-11-21 18:34:53 +0100
committerEike Rathke <erack@redhat.com>2012-11-21 18:35:53 +0100
commitb8a467b70756b83c8aeb77f385ea1e368350d370 (patch)
treeeb0c2a0f560899b634ef8598f9022f4af24f1427 /unotools/source/config
parentbe677b568690415ff90e7937d7269d3b41b39c16 (diff)
obtain LanguageTag from SvtSysLocale
Change-Id: Iaee25f1d92349704eaae45e6582d31dfa718ddcb
Diffstat (limited to 'unotools/source/config')
-rw-r--r--unotools/source/config/compatibility.cxx2
-rw-r--r--unotools/source/config/fontcfg.cxx4
-rw-r--r--unotools/source/config/syslocaleoptions.cxx44
3 files changed, 9 insertions, 41 deletions
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index 8278137c61bb..e5079a9886d2 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -404,7 +404,7 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl()
if ( !bDefaultFound && aItem.sName.equals( COMPATIBILITY_DEFAULT_NAME ) != sal_False )
{
SvtSysLocale aSysLocale;
- com::sun::star::lang::Locale aLocale = aSysLocale.GetLocale();
+ com::sun::star::lang::Locale aLocale = aSysLocale.GetLanguageTag().getLocale();
if ( aLocale.Language == "zh" || aLocale.Language == "ja" || aLocale.Language == "ko" )
aItem.bExpandWordSpace = false;
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index 314fed44faa3..ce1f465f2a6c 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -252,7 +252,7 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale )
{
Locale aLocale = rLocale;
if( aLocale.Language.isEmpty() )
- aLocale = SvtSysLocale().GetUILocale();
+ aLocale = SvtSysLocale().GetUILanguageTag().getLocale();
OUString aUIFont = getDefaultFont( aLocale, DEFAULTFONT_UI_SANS );
@@ -1160,7 +1160,7 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam
aLocale.Variant = rLocale.Variant.toAsciiUpperCase();
if( aLocale.Language.isEmpty() )
- aLocale = SvtSysLocale().GetUILocale();
+ aLocale = SvtSysLocale().GetUILanguageTag().getLocale();
while( !aLocale.Language.isEmpty() )
{
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index 10c7574d5623..785cf33611d0 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -49,26 +49,6 @@ namespace
: public rtl::Static<Link, CurrencyChangeLink> {};
}
-static com::sun::star::lang::Locale lcl_str_to_locale( const ::rtl::OUString rStr )
-{
- com::sun::star::lang::Locale aRet;
- if ( !rStr.isEmpty() )
- {
- aRet = com::sun::star::lang::Locale();
- sal_Int32 nSep = rStr.indexOf('-');
- if (nSep < 0)
- aRet.Language = rStr;
- else
- {
- aRet.Language = rStr.copy(0, nSep);
- if (nSep < rStr.getLength())
- aRet.Country = rStr.copy(nSep+1, rStr.getLength() - (nSep+1));
- }
- }
-
- return aRet;
-}
-
class SvtSysLocaleOptions_Impl : public utl::ConfigItem
{
LanguageTag m_aRealLocale;
@@ -121,10 +101,8 @@ public:
void SetIgnoreLanguageChange( sal_Bool bSet);
sal_Bool IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const;
- const Locale& GetRealLocale() { return m_aRealLocale.getLocale(); }
- const Locale& GetRealUILocale() { return m_aRealUILocale.getLocale(); }
- LanguageType GetRealLanguage() { return m_aRealLocale.getLanguageType(); }
- LanguageType GetRealUILanguage() { return m_aRealUILocale.getLanguageType(); }
+ const LanguageTag& GetRealLocale() { return m_aRealLocale; }
+ const LanguageTag& GetRealUILocale() { return m_aRealUILocale; }
};
@@ -755,30 +733,20 @@ void SvtSysLocaleOptions::ConfigurationChanged( utl::ConfigurationBroadcaster* p
::utl::detail::Options::ConfigurationChanged( p, nHint );
}
-com::sun::star::lang::Locale SvtSysLocaleOptions::GetLocale() const
+LanguageTag SvtSysLocaleOptions::GetLanguageTag() const
{
- return lcl_str_to_locale( GetLocaleConfigString() );
+ return LanguageTag( GetLocaleConfigString() );
}
-com::sun::star::lang::Locale SvtSysLocaleOptions::GetRealLocale() const
+const LanguageTag & SvtSysLocaleOptions::GetRealLanguageTag() const
{
return pOptions->GetRealLocale();
}
-com::sun::star::lang::Locale SvtSysLocaleOptions::GetRealUILocale() const
+const LanguageTag & SvtSysLocaleOptions::GetRealUILanguageTag() const
{
return pOptions->GetRealUILocale();
}
-LanguageType SvtSysLocaleOptions::GetRealLanguage() const
-{
- return pOptions->GetRealLanguage();
-}
-
-LanguageType SvtSysLocaleOptions::GetRealUILanguage() const
-{
- return pOptions->GetRealUILanguage();
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */