[Libreoffice-commits] core.git: i18nlangtag/source include/i18nlangtag svl/source

Noel Grandin noel at peralex.com
Mon Apr 4 13:41:22 UTC 2016


 i18nlangtag/source/languagetag/languagetag.cxx |    6 +++---
 include/i18nlangtag/languagetag.hxx            |   13 +++++--------
 svl/source/numbers/zforlist.cxx                |    2 +-
 3 files changed, 9 insertions(+), 12 deletions(-)

New commits:
commit 8372d8532ba3aa3d1ec346a73d8fe9f406001f79
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 4 11:11:21 2016 +0200

    loplugin:constantparam in i18nlangtag
    
    Change-Id: I3d7cbac7ca58f3de9771a1221196f851255f3fb9
    Reviewed-on: https://gerrit.libreoffice.org/23802
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index dc8708b..e8df2a4 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -2268,15 +2268,15 @@ LanguageTag & LanguageTag::makeFallback()
 }
 
 
-bool LanguageTag::equals( const LanguageTag & rLanguageTag, bool bResolveSystem ) const
+bool LanguageTag::equals( const LanguageTag & rLanguageTag ) const
 {
     // If SYSTEM is not to be resolved or either both are SYSTEM or none, we
     // can use the operator==() optimization.
-    if (!bResolveSystem || isSystemLocale() == rLanguageTag.isSystemLocale())
+    if (isSystemLocale() == rLanguageTag.isSystemLocale())
         return operator==( rLanguageTag);
 
     // Compare full language tag strings.
-    return getBcp47( bResolveSystem) == rLanguageTag.getBcp47( bResolveSystem);
+    return getBcp47() == rLanguageTag.getBcp47();
 }
 
 
diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx
index 2bbf033..f494d78 100644
--- a/include/i18nlangtag/languagetag.hxx
+++ b/include/i18nlangtag/languagetag.hxx
@@ -361,19 +361,16 @@ public:
 
     /** Test equality of two LanguageTag, possibly resolving system locale.
 
-        @param bResolveSystem
-               If TRUE, resolve empty language tags denoting the system
-               locale to the real locale used before comparing.
-               If FALSE, the behavior is identical to operator==(), system
-               locales are not resolved first.
+        Resolve empty language tags denoting the system
+        locale to the real locale used before comparing.
       */
-    bool                            equals( const LanguageTag & rLanguageTag, bool bResolveSystem = false ) const;
+    bool    equals( const LanguageTag & rLanguageTag ) const;
 
     /** Test equality of two LanguageTag.
 
         Does NOT resolve system, i.e. if the system locale is en-US
         LanguageTag("")==LanguageTag("en-US") returns false! Use
-        equals(...,true) instead if system locales shall be resolved.
+        equals(...) instead if system locales shall be resolved.
      */
     bool    operator==( const LanguageTag & rLanguageTag ) const;
 
@@ -381,7 +378,7 @@ public:
 
         Does NOT resolve system, i.e. if the system locale is en-US
         LanguageTag("")!=LanguageTag("en-US") returns true! Use
-        !equals(,...true) instead if system locales shall be resolved.
+        !equals(,..) instead if system locales shall be resolved.
      */
     bool    operator!=( const LanguageTag & rLanguageTag ) const;
 
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 70a013a..e7fcccc 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -954,7 +954,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge )
         if (LocaleDataWrapper::areChecksEnabled())
         {
             const LanguageTag& rLoadedLocale = xLocaleData->getLoadedLanguageTag();
-            if ( !rLoadedLocale.equals( maLanguageTag, true) )
+            if ( !rLoadedLocale.equals( maLanguageTag ) )
             {
                 OUString aMsg("SvNumberFormatter::ImpGenerateCL: locales don't match:");
                 LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg ));


More information about the Libreoffice-commits mailing list