[Libreoffice-commits] .: 2 commits - desktop/source tools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 27 13:29:24 PST 2012


 desktop/source/app/app.cxx |   14 +++++---------
 tools/source/rc/resmgr.cxx |    6 ++++++
 2 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit c8209ae6ae2a2e33c63fda48efc7c3381cd095b2
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Nov 27 22:28:43 2012 +0100

    added FIXME markers
    
    Change-Id: I7f9b5f9843c6f20fec17cec1e43d49624922b4fe

diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 2f35eef..8ddef9c 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -270,6 +270,7 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
     OUStringBuffer aSearch( rPrefix.getLength() + 16 );
     boost::unordered_map< OUString, ContainerElement, OUStringHash >::iterator it = m_aResFiles.end();
 
+    /* FIXME-BCP47: handle language tags! */
     int nTries = 0;
     if( !aLocale.Language.isEmpty() )
         nTries = 1;
@@ -362,6 +363,7 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
     // give up
     if( it == m_aResFiles.end() )
     {
+        /* FIXME-BCP47: handle language tags! */
         OUStringBuffer sKey = rPrefix;
         sKey.append( rLocale.Language );
         if( !rLocale.Country.isEmpty() )
@@ -423,6 +425,7 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
 
 InternalResMgr* ResMgrContainer::getNextFallback( InternalResMgr* pMgr )
 {
+    /* FIXME-BCP47: handle language tags! */
     com::sun::star::lang::Locale aLocale = pMgr->aLocale;
     if( !aLocale.Variant.isEmpty() )
         aLocale.Variant = OUString();
@@ -1595,6 +1598,7 @@ ResMgr* ResMgr::CreateResMgr( const sal_Char* pPrefixName,
 
     OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
 
+    /* FIXME-BCP47: handle language tags! */
     if( aLocale.Language.isEmpty() )
         aLocale = ResMgrContainer::get().getDefLocale();
 
@@ -1615,6 +1619,7 @@ ResMgr* ResMgr::SearchCreateResMgr(
 
     OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
 
+    /* FIXME-BCP47: handle language tags! */
     if( rLocale.Language.isEmpty() )
         rLocale = ResMgrContainer::get().getDefLocale();
 
@@ -1824,6 +1829,7 @@ SimpleResMgr::SimpleResMgr( const sal_Char* pPrefixName,
     com::sun::star::lang::Locale aLocale( rLocale );
 
     osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
+    /* FIXME-BCP47: handle language tags! */
     if( aLocale.Language.isEmpty() )
         aLocale = ResMgrContainer::get().getDefLocale();
 
commit 76c22d36f15d1c2447ba9c7470a2d173e398bc03
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Nov 27 22:22:51 2012 +0100

    Desktop::GetDesktopResManager: handle language tag
    
    Change-Id: Ica043b923e0918f65fb6b18c4205ba91784ef3c2

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index bbbe228..cfa6a52 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -349,18 +349,14 @@ ResMgr* Desktop::GetDesktopResManager()
             // Use VCL to get the correct language specific message as we
             // are in the bootstrap process and not able to get the installed
             // language!!
-            /* FIXME-BCP47: handle language tag! */
             OUString aUILocaleString = LanguageSelection::getLanguageString();
-            sal_Int32 nIndex = 0;
-            OUString aLanguage = aUILocaleString.getToken( 0, '-', nIndex);
-            OUString aCountry = aUILocaleString.getToken( 0, '-', nIndex);
-            OUString aVariant = aUILocaleString.getToken( 0, '-', nIndex);
-
-            ::com::sun::star::lang::Locale aLocale( aLanguage, aCountry, aVariant );
-
+            LanguageTag aLanguageTag( aUILocaleString);
+            //! ResMgr may modify the Locale for fallback!
+            ::com::sun::star::lang::Locale aLocale( aLanguageTag.getLocale());
             Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLocale);
+            aLanguageTag.reset( aLocale);
             AllSettings as = GetSettings();
-            as.SetUILanguageTag(LanguageTag(aLocale));
+            as.SetUILanguageTag(aLanguageTag);
             SetSettings(as);
         }
     }


More information about the Libreoffice-commits mailing list