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

Heiko Tietze (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 30 18:46:35 UTC 2020


 cui/inc/strings.hrc          |    3 ---
 cui/source/dialogs/about.cxx |   34 ++++++++--------------------------
 2 files changed, 8 insertions(+), 29 deletions(-)

New commits:
commit 35f5520fc83a2c69a5d5eef283a37b1553c8ed65
Author:     Heiko Tietze <tietze.heiko at gmail.com>
AuthorDate: Thu Apr 30 16:32:59 2020 +0200
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Thu Apr 30 20:45:59 2020 +0200

    Drop obsolete variable strings
    
    Change-Id: I0cd96b3466f94681567663625aa662717630e92f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93220
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index 1049f7e7ff4f..df99edb217b2 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -381,14 +381,11 @@
 
 #define RID_SVXSTR_CANNOTCONVERTURL_ERR             NC_("RID_SVXSTR_CANNOTCONVERTURL_ERR", "The URL <%1> cannot be converted to a filesystem path.")
 
-#define RID_SVXSTR_ABOUT_VERSION                    NC_("aboutdialog|textbuffer1", "%ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX")
 #define RID_SVXSTR_ABOUT_COPYRIGHT                  NC_("aboutdialog|copyright", "Copyright © 2000–2020 LibreOffice contributors.")
 #define RID_SVXSTR_ABOUT_CREDITS_URL                NC_("aboutdialog|link", "https://www.libreoffice.org/about-us/credits/")
-#define RID_SVXSTR_ABOUT_BUILDID                    NC_("aboutdialog|buildid", "$BUILDID")
 #define RID_SVXSTR_ABOUT_VENDOR                     NC_("aboutdialog|vendor", "This release was supplied by %OOOVENDOR.")
 #define RID_SVXSTR_ABOUT_BASED_ON                   NC_("aboutdialog|libreoffice", "LibreOffice was based on OpenOffice.org.")
 #define RID_SVXSTR_ABOUT_DERIVED                    NC_("aboutdialog|derived", "%PRODUCTNAME is derived from LibreOffice which was based on OpenOffice.org")
-#define RID_SVXSTR_ABOUT_LOCALE                     NC_("aboutdialog|locale", "$LOCALE")
 #define RID_SVXSTR_ABOUT_UILOCALE                   NC_("aboutdialog|uilocale", "UI-Language: $LOCALE")
 
 #define RID_SVXSTR_EDIT_PATHS                       NC_("optpathspage|editpaths", "Edit Paths: %1")
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 845ad5496a37..c07a8c964586 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -142,7 +142,7 @@ bool AboutDialog::IsStringValidGitHash(const OUString &hash) {
 }
 
 OUString AboutDialog::GetVersionString() {
-  OUString sVersion = CuiResId(RID_SVXSTR_ABOUT_VERSION);
+  OUString sVersion = CuiResId("%ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX");
 
 #ifdef _WIN64
   sVersion += " (x64)";
@@ -163,18 +163,7 @@ OUString AboutDialog::GetBuildString() {
   }
   OSL_ENSURE(!sBuildId.isEmpty(), "No BUILDID in bootstrap file");
 
-  OUString sBuildStr;
-
-  if (!sBuildId.trim().isEmpty()) {
-    sBuildStr = CuiResId(RID_SVXSTR_ABOUT_BUILDID);
-    if (sBuildStr.indexOf("$BUILDID") == -1) {
-      SAL_WARN("cui.dialogs", "translated Build Id string in translations "
-                              "doesn't contain $BUILDID placeholder");
-      sBuildStr += " $BUILDID";
-    }
-    sBuildStr = sBuildStr.replaceAll("$BUILDID", sBuildId);
-  }
-  return sBuildStr;
+  return sBuildId;
 }
 
 OUString AboutDialog::GetEnvString() { return Application::GetHWOSConfInfo(1); }
@@ -182,29 +171,22 @@ OUString AboutDialog::GetUIString() { return Application::GetHWOSConfInfo(2); }
 
 OUString AboutDialog::GetLocaleString() {
 
-  OUString aLocaleStr;
+  OUString sLocaleStr;
 
   rtl_Locale *pLocale;
   osl_getProcessLocale(&pLocale);
   if (pLocale && pLocale->Language) {
     if (pLocale->Country && rtl_uString_getLength(pLocale->Country) > 0)
-      aLocaleStr = OUString::unacquired(&pLocale->Language) + "_" +
+      sLocaleStr = OUString::unacquired(&pLocale->Language) + "_" +
                    OUString::unacquired(&pLocale->Country);
     else
-      aLocaleStr = OUString(pLocale->Language);
+      sLocaleStr = OUString(pLocale->Language);
     if (pLocale->Variant && rtl_uString_getLength(pLocale->Variant) > 0)
-      aLocaleStr += OUString(pLocale->Variant);
+      sLocaleStr += OUString(pLocale->Variant);
   }
 
-  aLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" +
-               aLocaleStr + ")";
-  OUString sLocaleStr(CuiResId(RID_SVXSTR_ABOUT_LOCALE));
-  if (sLocaleStr.indexOf("$LOCALE") == -1) {
-    SAL_WARN("cui.dialogs", "translated locale string in translations doesn't "
-                            "contain $LOCALE placeholder");
-    sLocaleStr += " $LOCALE";
-  }
-  sLocaleStr = sLocaleStr.replaceAll("$LOCALE", aLocaleStr);
+  sLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" +
+               sLocaleStr + ")";
 
   OUString aUILocaleStr =
       Application::GetSettings().GetUILanguageTag().getBcp47();


More information about the Libreoffice-commits mailing list