cui/source/options/optgdlg.cxx                     |   20 ++------------------
 cui/source/options/optlingu.cxx                    |    3 ++-
 editeng/source/misc/svxacorr.cxx                   |    5 ++---
 librelogo/source/LibreLogo/LibreLogo.py            |    3 +++
 scripting/source/stringresource/stringresource.cxx |    8 ++++++++
 5 files changed, 17 insertions(+), 22 deletions(-)

New commits:
commit 3f1a58884eba6a7cee5a208e0f3de768d1377398
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jul 10 21:47:40 2013 +0200

    added FIXME-BCP47 comments
    
    Change-Id: I9e47a22f8a061461bfb0f21e74ae001e719f04b6

diff --git a/scripting/source/stringresource/stringresource.cxx 
b/scripting/source/stringresource/stringresource.cxx
index 8d8bade..c5c8b91 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -1691,6 +1691,10 @@ bool checkNamingSceme( const OUString& aName, const 
OUString& aNameBase,
     {
         bSuccess = true;
 
+        /* FIXME-BCP47: this uses '_' underscore character as separator and
+         * also appends Variant, which can't be blindly changed as it would
+         * violate the naming scheme in use. */
+
         sal_Int32 iStart = nNameBaseLen + 1;
         sal_Int32 iNext_ = aName.indexOf( '_', iStart );
         if( iNext_ != -1 && iNext_ < nNameLen-1 )
@@ -1821,6 +1825,10 @@ bool StringResourcePersistenceImpl::implLoadLocale( 
LocaleItem* )
 
 OUString implGetNameScemeForLocaleItem( const LocaleItem* pLocaleItem )
 {
+    /* FIXME-BCP47: this uses '_' underscore character as separator and
+     * also appends Variant, which can't be blindly changed as it would
+     * violate the naming scheme in use. */
+
     static OUString aUnder("_");
 
     OSL_ENSURE( pLocaleItem,
commit 61436eface0070ad2431bae1cf716d607c8a9a4f
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jul 10 21:35:09 2013 +0200

    added FIXME-BCP47 comment
    
    Change-Id: I8a8ba4ac9e5318935f9b52ca7fdb8e018e76e715

diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index bf925c8..c13c705 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -587,6 +587,9 @@ def __setlang__():
         global _
         c = _.doc.CurrentController.getViewCursor()
         locs = [i for i in [c.CharLocale, c.CharLocaleAsian, 
c.CharLocaleComplex] if i.Language != 'zxx'] # not None language
+               # FIXME-BCP47: this needs adaption to language tags, a simple 
split on
+               # '-' and assuming second field would be country would already 
fail if
+               # a script tag was present.
         loc = Locale(__uilocale__.split('-')[0], __uilocale__.split('-')[1], 
'')
         if locs and loc not in locs:
             loc = locs[0]
commit a0f20ee1d5665ad8f6c686b04a16462e4979a29f
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jul 10 21:20:05 2013 +0200

    use LanguageTag
    
    Change-Id: Ibbe84ddde5c9d7fbcb9920ea76896c44c0cdf387

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index b06e69a..d06b9d2 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -621,11 +621,10 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace(
     bool bRet = false;
 
     CharClass& rCC = GetCharClass( eLang );
-    const lang::Locale rLocale = rCC.getLanguageTag().getLocale( );
 
-    if ( rLocale.Language == OUString( "fr" ) )
+    if ( rCC.getLanguageTag().getLanguage() == "fr" )
     {
-        bool bFrCA = rLocale.Country == OUString( "CA" );
+        bool bFrCA = (rCC.getLanguageTag().getCountry() == "CA");
         OUString allChars = OUString( ":;?!%" );
         OUString chars( allChars );
         if ( bFrCA )
commit c60257f4deddf9b82fc462921e9d25f3a3d56e67
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jul 10 21:13:05 2013 +0200

    comparing only language and country is now insufficient
    
    Change-Id: I399a5c5444b7352be7fa541fba3112745ce97033

diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 6fe2d9d..4398ce1 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -656,7 +656,8 @@ static void lcl_MergeLocales(Sequence< Locale >& 
aAllLocales, const Sequence< Lo
         for(sal_Int32 j = 0; j < aAllLocales.getLength() && !bFound; j++)
         {
             bFound = pAdd[i].Language == pAllLocales[j].Language &&
-                pAdd[i].Country == pAllLocales[j].Country;
+                pAdd[i].Country == pAllLocales[j].Country &&
+                pAdd[i].Variant == pAllLocales[j].Variant;
         }
         if(!bFound)
         {
commit f8e34b5c1281b32ad28087e458cd926b15955527
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jul 10 21:07:01 2013 +0200

    use LanguageTag to convert
    
    Change-Id: I2e35ac3d905fc4837dbc68fe6c97ed4891a85400

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index a0f6284..6e0cb47 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1148,22 +1148,6 @@ SfxTabPage* OfaLanguagesTabPage::Create( Window* 
pParent, const SfxItemSet& rAtt
     return new OfaLanguagesTabPage(pParent, rAttrSet);
 }
 
-static LanguageType lcl_LangStringToLangType(const OUString& rLang)
-{
-    Locale aLocale;
-    sal_Int32 nSep = rLang.indexOf('-');
-    if (nSep < 0)
-        aLocale.Language = rLang;
-    else
-    {
-        aLocale.Language = rLang.copy(0, nSep);
-        if (nSep < rLang.getLength())
-            aLocale.Country = rLang.copy(nSep+1, rLang.getLength() - (nSep+1));
-    }
-    LanguageType eLangType = LanguageTag( aLocale ).getLanguageType();
-    return eLangType;
-}
-
 static void lcl_UpdateAndDelete(SfxVoidItem* pInvalidItems[], SfxBoolItem* 
pBoolItems[], sal_uInt16 nCount)
 {
     SfxViewFrame* pCurrentFrm = SfxViewFrame::Current();
@@ -1261,7 +1245,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& 
rSet )
 
     OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString();
     LanguageType eOldLocale = (!sLang.isEmpty() ?
-        lcl_LangStringToLangType( sLang ) : LANGUAGE_SYSTEM);
+        LanguageTag( sLang ).getLanguageType() : LANGUAGE_SYSTEM);
     LanguageType eNewLocale = m_pLocaleSettingLB->GetSelectLanguage();
     if ( eOldLocale != eNewLocale )
     {
@@ -1423,7 +1407,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
 {
     OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString();
     if ( !sLang.isEmpty() )
-        m_pLocaleSettingLB->SelectLanguage(lcl_LangStringToLangType(sLang));
+        
m_pLocaleSettingLB->SelectLanguage(LanguageTag(sLang).getLanguageType());
     else
         m_pLocaleSettingLB->SelectLanguage( LANGUAGE_USER_SYSTEM_CONFIG );
     sal_Bool bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_LOCALE);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to