[Libreoffice-commits] core.git: 2 commits - cui/source

Eike Rathke erack at redhat.com
Tue Apr 28 04:27:26 PDT 2015


 cui/source/dialogs/about.cxx |   25 +++++++++++++++----------
 cui/source/inc/about.hxx     |    2 +-
 2 files changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 9fdde6457d3d07b01c4bfc300637533a7dccb920
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Apr 28 13:24:36 2015 +0200

    use sensible variable naming, tdf#85432 follow-up
    
    Change-Id: Ibb468ff3b4c3210c4c5df60fbd42d74884bbfdb3

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index ed4fcc3..6302808 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -76,7 +76,7 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
     m_aVersionTextStr = m_pVersion->GetText();
     m_aBasedTextStr = get<FixedText>("libreoffice")->GetText();
     m_aBasedDerivedTextStr = get<FixedText>("derived")->GetText();
-    m_pLocaleStr = get<FixedText>("locale")->GetText();;
+    m_aLocaleStr = get<FixedText>("locale")->GetText();;
 
     m_pVersion->SetText(GetVersionString());
 
@@ -234,7 +234,7 @@ OUString AboutDialog::GetBuildId()
 
 OUString AboutDialog::GetLocaleString()
 {
-    OUString pLocaleStr;
+    OUString aLocaleStr;
     rtl_Locale * pLocale;
 
     osl_getProcessLocale( &pLocale );
@@ -242,14 +242,14 @@ OUString AboutDialog::GetLocaleString()
     if ( pLocale && pLocale->Language )
     {
         if (pLocale->Country && rtl_uString_getLength( pLocale->Country) > 0)
-            pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+            aLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
         else
-            pLocaleStr = OUString(pLocale->Language);
+            aLocaleStr = OUString(pLocale->Language);
         if (pLocale->Variant && rtl_uString_getLength( pLocale->Variant) > 0)
-            pLocaleStr += OUString(pLocale->Variant);
+            aLocaleStr += OUString(pLocale->Variant);
     }
 
-    return pLocaleStr;
+    return aLocaleStr;
 }
 
 OUString AboutDialog::GetVersionString()
@@ -264,7 +264,7 @@ OUString AboutDialog::GetVersionString()
 
     OUString sBuildId = GetBuildId();
 
-    OUString pLocaleStr = GetLocaleString();
+    OUString aLocaleStr = GetLocaleString();
 
     if (!sBuildId.trim().isEmpty())
     {
@@ -282,15 +282,15 @@ OUString AboutDialog::GetVersionString()
         sVersion += "\n" EXTRA_BUILDID;
     }
 
-    if (!pLocaleStr.trim().isEmpty())
+    if (!aLocaleStr.trim().isEmpty())
     {
         sVersion += "\n";
-        if (m_pLocaleStr.indexOf("$LOCALE") == -1)
+        if (m_aLocaleStr.indexOf("$LOCALE") == -1)
         {
             SAL_WARN( "cui.dialogs", "translated locale string in translations doesn't contain $LOCALE placeholder" );
-            m_pLocaleStr += " $LOCALE";
+            m_aLocaleStr += " $LOCALE";
         }
-        sVersion += m_pLocaleStr.replaceAll("$LOCALE", pLocaleStr);
+        sVersion += m_aLocaleStr.replaceAll("$LOCALE", aLocaleStr);
     }
 
     return sVersion;
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 132ab54..c9c6983 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -49,7 +49,7 @@ private:
     OUString m_aBasedDerivedTextStr;
     OUString m_aCreditsLinkStr;
     OUString m_sBuildStr;
-    OUString m_pLocaleStr;
+    OUString m_aLocaleStr;
 
     void StyleControls();
     void SetLogo();
commit f318e305b6afa715ef759b8589823da53b812a88
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

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index f5761d3..ed4fcc3 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -239,9 +239,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