[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 19 08:53:58 PST 2012


 sc/source/core/tool/addincol.cxx          |    8 ++++----
 sc/source/core/tool/cellkeytranslator.cxx |    2 +-
 sc/source/filter/xml/xmlimprt.cxx         |    2 +-
 sc/source/ui/dbgui/tpsort.cxx             |    8 ++++----
 sc/source/ui/docshell/impex.cxx           |    6 +++---
 sc/source/ui/unoobj/convuno.cxx           |    6 +++---
 sc/source/ui/unoobj/defltuno.cxx          |    4 ++--
 7 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 36e2f00bca174342ba1391e49c56c4602ec97394
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Nov 19 17:49:18 2012 +0100

    use LanguageTag
    
    Change-Id: I93bc72d3938775b4e7c599b0477a76ed0ce5d4ac

diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 4ca1cff..d7a19cd 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 #include <comphelper/processfactory.hxx>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 #include <vcl/svapp.hxx>
 #include <sfx2/objsh.hxx>
 #include <unotools/charclass.hxx>
@@ -185,7 +185,7 @@ sal_Bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, ::rtl::OUStri
         long i;
 
         rtl::OUString aLangStr, aCountryStr;
-        MsLangId::convertLanguageToIsoNames( eDestLang, aLangStr, aCountryStr );
+        LanguageTag( eDestLang ).getIsoLanguageCountry( aLangStr, aCountryStr );
         rtl::OUString aUserLang = aLangStr.toAsciiLowerCase();
         rtl::OUString aUserCountry = aCountryStr.toAsciiUpperCase();
 
@@ -792,7 +792,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
         //  AddIns must use the language for which the office is installed
         LanguageType eOfficeLang = Application::GetSettings().GetUILanguage();
 
-        lang::Locale aLocale( MsLangId::convertLanguageToLocale( eOfficeLang ));
+        lang::Locale aLocale( LanguageTag( eOfficeLang ).getLocale());
         xAddIn->setLocale( aLocale );
 
         ::rtl::OUString aServiceName( xName->getServiceName() );
@@ -1047,7 +1047,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface
     if ( xLoc.is() )        // optional in new add-ins
     {
         LanguageType eOfficeLang = Application::GetSettings().GetUILanguage();
-        lang::Locale aLocale( MsLangId::convertLanguageToLocale( eOfficeLang ));
+        lang::Locale aLocale( LanguageTag( eOfficeLang ).getLocale());
         xLoc->setLocale( aLocale );
     }
 
diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index 1a654b5..fd74e96 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -165,7 +165,7 @@ void ScCellKeywordTranslator::transKeyword(String& rName, const Locale* pLocale,
     if ( !spInstance.get() )
         spInstance.reset( new ScCellKeywordTranslator );
 
-    LanguageType eLang = pLocale ? MsLangId::convertLocaleToLanguageWithFallback(*pLocale) : LANGUAGE_SYSTEM;
+    LanguageType eLang = pLocale ? LanguageTag(*pLocale).makeFallback().getLanguageType() : LANGUAGE_SYSTEM;
     Sequence<sal_Int32> aOffsets;
     rName = spInstance->maTransWrapper.transliterate(rName, eLang, 0, rName.Len(), &aOffsets);
     lclMatchKeyword(rName, spInstance->maStringNameMap, eOpCode, pLocale);
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 14d1022..b16dba4 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2301,7 +2301,7 @@ void ScXMLImport::ExamineDefaultStyle()
                 else
                 {
                     LocaleDataWrapper aLocaleData( comphelper::getComponentContext(pDoc->GetServiceManager()),
-                        MsLangId::convertLanguageToLocale( nFormatLang ) );
+                        LanguageTag( nFormatLang ).getLocale() );
                     aDecSep = aLocaleData.getNumDecimalSep();
                 }
 
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 0955b8a..6c075bb 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -30,7 +30,7 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <vcl/msgbox.hxx>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 #include <svtools/collatorres.hxx>
 #include <unotools/collatorwrapper.hxx>
 #include <unotools/localedatawrapper.hxx>
@@ -682,7 +682,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
         aBtnHeader.SetText( aStrRowLabel );
     }
 
-    LanguageType eLang = MsLangId::convertLocaleToLanguage( aSortData.aCollatorLocale );
+    LanguageType eLang = LanguageTag( aSortData.aCollatorLocale ).getLanguageType( false);
     if ( eLang == LANGUAGE_DONTKNOW )
         eLang = LANGUAGE_SYSTEM;
     aLbLanguage.SelectLanguage( eLang );
@@ -749,7 +749,7 @@ sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
 
     // get locale
     LanguageType eLang = aLbLanguage.GetSelectLanguage();
-    aNewSortData.aCollatorLocale = MsLangId::convertLanguageToLocale( eLang, false );
+    aNewSortData.aCollatorLocale = LanguageTag( eLang ).getLocale( false );
 
     // get algorithm
     rtl::OUString sAlg;
@@ -976,7 +976,7 @@ IMPL_LINK_NOARG(ScTabPageSortOptions, FillAlgorHdl)
     }
     else
     {
-        lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang ));
+        lang::Locale aLocale( LanguageTag( eLang ).getLocale());
         uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( aLocale );
 
         long nCount = aAlgos.getLength();
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 3d1d391..4e5946e 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -29,7 +29,7 @@
 #include "sc.hrc"
 
 #include <comphelper/processfactory.hxx>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 #include <sot/formats.hxx>
 #include <sfx2/mieclip.hxx>
 #include <com/sun/star/i18n/CalendarFieldIndex.hpp>
@@ -1297,7 +1297,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
     aTransliteration.loadModuleIfNeeded( eDocLang );
     CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) );
     aCalendar.loadDefaultCalendar(
-        MsLangId::convertLanguageToLocale( eDocLang ) );
+        LanguageTag( eDocLang ).getLocale() );
     ::utl::TransliterationWrapper* pEnglishTransliteration = NULL;
     CalendarWrapper* pEnglishCalendar = NULL;
     if ( eDocLang != LANGUAGE_ENGLISH_US )
@@ -1307,7 +1307,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
         aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US );
         pEnglishCalendar = new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) );
         pEnglishCalendar->loadDefaultCalendar(
-            MsLangId::convertLanguageToLocale( LANGUAGE_ENGLISH_US ) );
+            LanguageTag( LANGUAGE_ENGLISH_US ).getLocale() );
     }
 
     rtl::OUString aLine;
diff --git a/sc/source/ui/unoobj/convuno.cxx b/sc/source/ui/unoobj/convuno.cxx
index 01f28e5..eff039e 100644
--- a/sc/source/ui/unoobj/convuno.cxx
+++ b/sc/source/ui/unoobj/convuno.cxx
@@ -26,7 +26,7 @@
  *
  ************************************************************************/
 
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 
 #include "convuno.hxx"
 #include "global.hxx"
@@ -43,7 +43,7 @@ LanguageType ScUnoConversion::GetLanguage( const lang::Locale& rLocale )
     if ( rLocale.Language.isEmpty() )
         return LANGUAGE_SYSTEM;
 
-    LanguageType eRet = MsLangId::convertLocaleToLanguage( rLocale );
+    LanguageType eRet = LanguageTag( rLocale ).getLanguageType( false);
     if ( eRet == LANGUAGE_NONE )
         eRet = LANGUAGE_SYSTEM;         //! or throw an exception?
 
@@ -52,7 +52,7 @@ LanguageType ScUnoConversion::GetLanguage( const lang::Locale& rLocale )
 
 void ScUnoConversion::FillLocale( lang::Locale& rLocale, LanguageType eLang )
 {
-    MsLangId::convertLanguageToLocale( eLang, rLocale );
+    rLocale = LanguageTag( eLang ).getLocale();
 }
 
 
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index b0c0084..3c41e50 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -31,7 +31,7 @@
 #include <svl/itemprop.hxx>
 #include <svx/unomid.hxx>
 #include <vcl/svapp.hxx>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 
@@ -192,7 +192,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue(
         {
             LanguageType eNew;
             if (!aLocale.Language.isEmpty() || !aLocale.Country.isEmpty())
-                eNew = MsLangId::convertLocaleToLanguage( aLocale );
+                eNew = LanguageTag( aLocale ).getLanguageType( false);
             else
                 eNew = LANGUAGE_NONE;
 


More information about the Libreoffice-commits mailing list