Kaydet (Commit) 3dd16c68 authored tarafından Eike Rathke's avatar Eike Rathke

use LanguageTag to convert

Change-Id: I689bb64664ee36b2e3e8386ebd20cdd95c51142b
üst 96086484
...@@ -401,9 +401,7 @@ void SfxDocTplService_Impl::init_Impl() ...@@ -401,9 +401,7 @@ void SfxDocTplService_Impl::init_Impl()
getDefaultLocale(); getDefaultLocale();
// convert locale to string // convert locale to string
OUString aLang = maLocale.Language; OUString aLang = LanguageTag( maLocale).getBcp47();
aLang += OUString( '-' );
aLang += maLocale.Country;
// set maRootContent to the root of the templates hierarchy. Create the // set maRootContent to the root of the templates hierarchy. Create the
// entry if necessary // entry if necessary
...@@ -490,31 +488,7 @@ void SfxDocTplService_Impl::getDefaultLocale() ...@@ -490,31 +488,7 @@ void SfxDocTplService_Impl::getDefaultLocale()
::osl::MutexGuard aGuard( maMutex ); ::osl::MutexGuard aGuard( maMutex );
if ( !mbLocaleSet ) if ( !mbLocaleSet )
{ {
OUString aLocale( utl::ConfigManager::getLocale() ); maLocale = LanguageTag( utl::ConfigManager::getLocale()).getLocale( false);
if ( !aLocale.isEmpty() )
{
sal_Int32 nPos = aLocale.indexOf( sal_Unicode( '-' ) );
if ( nPos != -1 )
{
maLocale.Language = aLocale.copy( 0, nPos );
nPos = aLocale.indexOf( sal_Unicode( '_' ), nPos + 1 );
if ( nPos != -1 )
{
maLocale.Country
= aLocale.copy( maLocale.Language.getLength() + 1,
nPos - maLocale.Language.getLength() - 1 );
maLocale.Variant
= aLocale.copy( nPos + 1 );
}
else
{
maLocale.Country
= aLocale.copy( maLocale.Language.getLength() + 1 );
}
}
}
mbLocaleSet = sal_True; mbLocaleSet = sal_True;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment