From a1437ce16255b35f0b5fa1ace5194266a53ee36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 4 Apr 2022 17:09:46 +0200 Subject: [PATCH] Implement missing QSupportedWritingSystems comparison operators The operators were exported, but not implemented. Change-Id: I6c89c1f4b76040d2388b3a10afc6eeeb52638e1b Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qplatformfontdatabase.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index adb3c859e12..6ac798855e6 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -164,6 +164,26 @@ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWr return *this; } +bool operator==(const QSupportedWritingSystems &lhs, const QSupportedWritingSystems &rhs) +{ + return !(lhs != rhs); +} + +bool operator!=(const QSupportedWritingSystems &lhs, const QSupportedWritingSystems &rhs) +{ + if (lhs.d == rhs.d) + return false; + + Q_ASSERT(lhs.d->list.size() == rhs.d->list.size()); + Q_ASSERT(lhs.d->list.size() == QFontDatabase::WritingSystemsCount); + for (int i = 0; i < QFontDatabase::WritingSystemsCount; ++i) { + if (lhs.d->list.at(i) != rhs.d->list.at(i)) + return true; + } + + return false; +} + #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, const QSupportedWritingSystems &sws) {