[Libreoffice-commits] .: editeng/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 16 14:25:42 PST 2012


 editeng/source/editeng/editeng.cxx  |    2 +-
 editeng/source/editeng/editview.cxx |    4 ++--
 editeng/source/items/textitem.cxx   |    6 +++---
 editeng/source/misc/svxacorr.cxx    |    2 +-
 editeng/source/misc/unolingu.cxx    |   10 +++++-----
 editeng/source/outliner/outlvw.cxx  |    4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 378e437fbe313e87b7e56f8f0a1fc4009470679c
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Nov 16 23:22:11 2012 +0100

    use LanguageTag
    
    Change-Id: If056193c803f70f8707373ed7ff7b1abbf953852

diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index f437564..8b191ea 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1362,7 +1362,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
                                 String aComplete;
 
                                 LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1));
-                                lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang));
+                                lang::Locale aLocale( LanguageTag( eLang).getLocale());
 
                                 if (!pImpEditEngine->xLocaleDataWrapper.isInitialized())
                                     pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLocale, eLang);
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 1ed54fc..86084a7 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -27,7 +27,7 @@
 #include <com/sun/star/i18n/WordType.hpp>
 #include <vcl/metric.hxx>
 
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 #include <svl/languageoptions.hxx>
 #include <svtools/ctrltool.hxx>
 #include <svtools/langtab.hxx>
@@ -102,7 +102,7 @@ static LanguageType lcl_CheckLanguage(
                 nLang = nTmpLang;
         }
         if (nLang == LANGUAGE_NONE) // language not found by looking up the sytem language...
-            nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale );
+            nLang = LanguageTag( aLocale ).makeFallback().getLanguageType();
         if (nLang == LANGUAGE_SYSTEM)
             nLang = nTmpLang;
         if (nLang == LANGUAGE_DONTKNOW)
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 401ca6f..25f998b 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -37,7 +37,7 @@
 #include <tools/tenccvt.hxx>
 
 #include <rtl/ustring.hxx>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 #include <svl/itemset.hxx>
 
 #include <svtools/langtab.hxx>
@@ -2607,7 +2607,7 @@ bool SvxLanguageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             rVal <<= (sal_Int16)(GetValue());
         break;
         case MID_LANG_LOCALE:
-            lang::Locale aRet( MsLangId::convertLanguageToLocale( GetValue(), false));
+            lang::Locale aRet( LanguageTag( GetValue()).getLocale( false));
             rVal <<= aRet;
         break;
     }
@@ -2635,7 +2635,7 @@ bool SvxLanguageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 return sal_False;
 
             if (!aLocale.Language.isEmpty() || !aLocale.Country.isEmpty())
-                SetValue(MsLangId::convertLocaleToLanguage( aLocale ));
+                SetValue( LanguageTag( aLocale ).getLanguageType( false));
             else
                 SetValue(LANGUAGE_NONE);
         }
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 3f2298a..d8ae94c 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1905,7 +1905,7 @@ sal_Bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
 String SvxAutoCorrect::GetAutoCorrFileName( LanguageType eLang,
                                             sal_Bool bNewFile, sal_Bool bTst ) const
 {
-    String sRet, sExt( MsLangId::convertLanguageToIsoString( eLang ) );
+    String sRet, sExt( LanguageTag( eLang ).getBcp47() );
     sExt.Insert('_', 0);
     sExt.AppendAscii( ".dat" );
     if( bNewFile )
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 022ab11..4648636 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -40,7 +40,7 @@
 
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/implbase1.hxx> // helper for implementations
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 #include <unotools/lingucfg.hxx>
 #include <unotools/ucbhelper.hxx>
 #include <unotools/localfilehelper.hxx>
@@ -131,7 +131,7 @@ void ThesDummy_Impl::GetCfgLocales()
         for (sal_Int32 i = 0;  i < nLen;  ++i)
         {
             pLocale[i] = SvxCreateLocale(
-                            MsLangId::convertIsoStringToLanguage( pNodeNames[i] ) );
+                            LanguageTag( pNodeNames[i] ).getLanguageType() );
         }
     }
 }
@@ -877,13 +877,13 @@ LanguageType SvxLocaleToLanguage( const Locale& rLocale )
     if ( rLocale.Language.isEmpty() )
         return LANGUAGE_NONE;
 
-    return MsLangId::convertLocaleToLanguage( rLocale );
+    return LanguageTag( rLocale ).getLanguageType();
 }
 
 Locale& SvxLanguageToLocale( Locale& rLocale, LanguageType eLang )
 {
     if ( eLang != LANGUAGE_NONE )
-        MsLangId::convertLanguageToLocale( eLang, rLocale );
+        rLocale = LanguageTag( eLang ).getLocale();
     else
         rLocale = Locale();
 
@@ -894,7 +894,7 @@ Locale SvxCreateLocale( LanguageType eLang )
 {
     Locale aLocale;
     if ( eLang != LANGUAGE_NONE )
-        MsLangId::convertLanguageToLocale( eLang, aLocale );
+        aLocale = LanguageTag( eLang ).getLocale();
 
     return aLocale;
 }
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index d96d755..eb3f877 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -28,7 +28,7 @@
 #include <editeng/fhgtitem.hxx>
 
 #include <svl/style.hxx>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
 
 #define _OUTLINER_CXX
 #include <editeng/outliner.hxx>
@@ -1325,7 +1325,7 @@ bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext(
     aText = pEditEngine->GetText( aTextSel );
     aTextSel.Adjust();
     LanguageType nLang = pEditEngine->GetLanguage( aTextSel.nStartPara, aTextSel.nStartPos );
-    String aLangText( MsLangId::convertLanguageToIsoString( nLang ) );
+    String aLangText( LanguageTag( nLang ).getBcp47() );
 
     // set word and locale to look up as status value
     String aStatusVal( aText );


More information about the Libreoffice-commits mailing list