diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-04-04 17:09:46 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-05-06 21:58:04 +0200 |
commit | a1437ce16255b35f0b5fa1ace5194266a53ee36b (patch) | |
tree | 964d34422ec51f935b64a2118f298600bad7c9b3 /src/gui | |
parent | 13e4cf6eaca8ac84b3e145ab3b20272d233987c9 (diff) |
Implement missing QSupportedWritingSystems comparison operators
The operators were exported, but not implemented.
Change-Id: I6c89c1f4b76040d2388b3a10afc6eeeb52638e1b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qplatformfontdatabase.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index adb3c859e1..6ac798855e 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) { |