X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/09fcd88955f6460d1f0d3d506118ce52c1090621..ee65598f95309d64d69cfb4dd4191b3f567551fb:/src/common/fontcmn.cpp diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index e973ffbc0d..c6b9720509 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -77,7 +77,7 @@ wxFont *wxFontBase::New(const wxString& strNativeFontDesc) wxNativeFontInfo *wxFontBase::GetNativeFontInfo() const { -#if !defined(__WXGTK__) && !defined(__WXMSW__) +#if !defined(__WXGTK__) && !defined(__WXMSW__) && !defined(__WXMGL__) wxNativeFontInfo *fontInfo = new wxNativeFontInfo; fontInfo->pointSize = GetPointSize(); @@ -96,7 +96,7 @@ wxNativeFontInfo *wxFontBase::GetNativeFontInfo() const void wxFontBase::SetNativeFontInfo(const wxNativeFontInfo& info) { -#if !defined(__WXGTK__) && !defined(__WXMSW__) +#if !defined(__WXGTK__) && !defined(__WXMSW__) && !defined(__WXMGL__) SetPointSize(info.pointSize); SetFamily(info.family); SetStyle(info.style); @@ -104,6 +104,8 @@ void wxFontBase::SetNativeFontInfo(const wxNativeFontInfo& info) SetUnderlined(info.underlined); SetFaceName(info.faceName); SetEncoding(info.encoding); +#else + (void)info; #endif } @@ -128,15 +130,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 @@ -181,7 +193,7 @@ wxString wxFontBase::GetWeightString() const } } -#if !defined(__WXGTK__) && !defined(__WXMSW__) +#if !defined(__WXGTK__) && !defined(__WXMSW__) && !defined(__WXMGL__) // ---------------------------------------------------------------------------- // wxNativeFontInfo @@ -202,7 +214,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) // // Ignore the version for now // - + token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE;