[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - cui/source

Eike Rathke erack at redhat.com
Thu Apr 30 01:22:39 PDT 2015


 cui/source/dialogs/about.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit e45f01a28eab1db7ef05224a8fb89a438f93c22e
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Apr 28 13:18:50 2015 +0200

    don't assume Country to be always present, tdf#85432 follow-up
    
    For example, 'C' was displayed as "C_"
    Also, append Variant if present to display the full locale identifier,
    for example "en_US.UTF-8"
    
    Change-Id: I00c7bf832df25c00cc014589c4662806f8bf1137
    (cherry picked from commit f318e305b6afa715ef759b8589823da53b812a88)
    Reviewed-on: https://gerrit.libreoffice.org/15557
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index b9e3306..2c39df8 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -240,9 +240,14 @@ OUString AboutDialog::GetLocaleString()
 
     osl_getProcessLocale( &pLocale );
 
-    if ( pLocale && pLocale->Language && pLocale->Country )
+    if ( pLocale && pLocale->Language )
     {
-        pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+        if (pLocale->Country && rtl_uString_getLength( pLocale->Country) > 0)
+            pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+        else
+            pLocaleStr = OUString(pLocale->Language);
+        if (pLocale->Variant && rtl_uString_getLength( pLocale->Variant) > 0)
+            pLocaleStr += OUString(pLocale->Variant);
     }
 
     return pLocaleStr;


More information about the Libreoffice-commits mailing list