summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i18npool/inc/i18npool/languagetag.hxx6
-rw-r--r--i18npool/source/languagetag/languagetag.cxx13
2 files changed, 19 insertions, 0 deletions
diff --git a/i18npool/inc/i18npool/languagetag.hxx b/i18npool/inc/i18npool/languagetag.hxx
index c5ce23254bea..cefb0de81c9a 100644
--- a/i18npool/inc/i18npool/languagetag.hxx
+++ b/i18npool/inc/i18npool/languagetag.hxx
@@ -196,6 +196,12 @@ public:
*/
LanguageTag & makeFallback();
+ /* Test equality of two LangageTag. */
+ bool operator==( const LanguageTag & rLanguageTag ) const;
+
+ /* Test inequality of two LangageTag. */
+ bool operator!=( const LanguageTag & rLanguageTag ) const;
+
private:
enum Decision
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 07b494f03106..cc9fc557ab0d 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -839,4 +839,17 @@ LanguageTag & LanguageTag::makeFallback()
}
+bool LanguageTag::operator==( const LanguageTag & rLanguageTag ) const
+{
+ // Compare full language tag strings but SYSTEM unresolved.
+ return getBcp47( false) == rLanguageTag.getBcp47( false);
+}
+
+
+bool LanguageTag::operator!=( const LanguageTag & rLanguageTag ) const
+{
+ return !operator==( rLanguageTag);
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */