summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-07-11 18:22:27 +0200
committerEike Rathke <erack@redhat.com>2013-07-11 19:15:50 +0200
commit3dd16c6838778b8a947cc5daddc89a354712cb47 (patch)
tree7b66abe9682f71f3cd23ce6ddd5c2e4118cd5396 /sfx2
parent96086484d3429ff849b468ef5d1ff8ac8e7874a9 (diff)
use LanguageTag to convert
Change-Id: I689bb64664ee36b2e3e8386ebd20cdd95c51142b
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/doctemplates.cxx30
1 files changed, 2 insertions, 28 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 62c28ccc941d..18ebc7234651 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -401,9 +401,7 @@ void SfxDocTplService_Impl::init_Impl()
getDefaultLocale();
// convert locale to string
- OUString aLang = maLocale.Language;
- aLang += OUString( '-' );
- aLang += maLocale.Country;
+ OUString aLang = LanguageTag( maLocale).getBcp47();
// set maRootContent to the root of the templates hierarchy. Create the
// entry if necessary
@@ -490,31 +488,7 @@ void SfxDocTplService_Impl::getDefaultLocale()
::osl::MutexGuard aGuard( maMutex );
if ( !mbLocaleSet )
{
- OUString aLocale( utl::ConfigManager::getLocale() );
- 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 );
- }
- }
-
- }
-
+ maLocale = LanguageTag( utl::ConfigManager::getLocale()).getLocale( false);
mbLocaleSet = sal_True;
}
}