i18npool/inc/i18npool/languagetag.hxx | 6 ++++++ i18npool/source/languagetag/languagetag.cxx | 13 +++++++++++++ 2 files changed, 19 insertions(+)
New commits: commit 6a05d3f816df5cbcaa88bed5bce445c6a78f9ca6 Author: Eike Rathke <er...@redhat.com> Date: Wed Nov 21 19:11:56 2012 +0100 added operator==() and operator!=() to LanguageTag Change-Id: I4f339ecaeb147a05f8882065e859902f8c14ac47 diff --git a/i18npool/inc/i18npool/languagetag.hxx b/i18npool/inc/i18npool/languagetag.hxx index c5ce232..cefb0de 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 07b494f..cc9fc55 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: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits