[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Wed Jul 10 08:04:37 PDT 2013


 sc/source/filter/oox/numberformatsbuffer.cxx |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 6768d2c7f2cf75c507ec2108cbbb5a8a6cf7fae9
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 10 17:01:49 2013 +0200

    use LanguageTag to convert to Locale
    
    Change-Id: Ib178b0da9e27a1a6566418fde94a1e04fd15c1e6

diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx
index 5b3a98c..e6f3815 100644
--- a/sc/source/filter/oox/numberformatsbuffer.cxx
+++ b/sc/source/filter/oox/numberformatsbuffer.cxx
@@ -2023,12 +2023,7 @@ void NumberFormatsBuffer::insertBuiltinFormats()
         aBuiltinMap[ OUString::createFromAscii( pTable->mpcLocale ) ] = pTable;
 
     // convert locale string to locale struct
-    Locale aSysLocale;
-    sal_Int32 nDashPos = maLocaleStr.indexOf( '-' );
-    if( nDashPos < 0 ) nDashPos = maLocaleStr.getLength();
-    aSysLocale.Language = maLocaleStr.copy( 0, nDashPos );
-    if( nDashPos + 1 < maLocaleStr.getLength() )
-        aSysLocale.Country = maLocaleStr.copy( nDashPos + 1 );
+    Locale aSysLocale( LanguageTag( maLocaleStr).getLocale());
 
     // build a list of table pointers for the current locale, with all parent tables
     typedef ::std::vector< const BuiltinFormatTable* > BuiltinVec;


More information about the Libreoffice-commits mailing list