X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/09fcd88955f6460d1f0d3d506118ce52c1090621..963a1fcd6e013eef52bf87ed99e19d9ab49563ef:/src/common/fontcmn.cpp?ds=inline diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index e973ffbc0d..44cca93b72 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -128,15 +128,25 @@ wxFont& wxFont::operator=(const wxFont& font) return (wxFont &)*this; } -// VZ: is it correct to compare pointers and not the contents? (FIXME) bool wxFontBase::operator==(const wxFont& font) const { - return GetFontData() == font.GetFontData(); + // either it is the same font, i.e. they share the same common data or they + // have different ref datas but still describe the same font + return GetFontData() == font.GetFontData() || + ( + Ok() == font.Ok() && + GetPointSize() == font.GetPointSize() && + GetFamily() == font.GetFamily() && + GetStyle() == font.GetStyle() && + GetUnderlined() == font.GetUnderlined() && + GetFaceName() == font.GetFaceName() && + GetEncoding() == font.GetEncoding() + ); } bool wxFontBase::operator!=(const wxFont& font) const { - return GetFontData() != font.GetFontData(); + return !(*this == font); } wxString wxFontBase::GetFamilyString() const