Improved equality test to ignore invalid attributes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2013-11-21 20:54:16 +00:00
parent 8e3bbb68f0
commit 7990c85a92

View File

@ -227,42 +227,43 @@ bool wxTextAttr::operator== (const wxTextAttr& attr) const
{ {
return GetFlags() == attr.GetFlags() && return GetFlags() == attr.GetFlags() &&
GetTextColour() == attr.GetTextColour() && (!HasTextColour() || (GetTextColour() == attr.GetTextColour())) &&
GetBackgroundColour() == attr.GetBackgroundColour() && (!HasBackgroundColour() || (GetBackgroundColour() == attr.GetBackgroundColour())) &&
GetAlignment() == attr.GetAlignment() && (!HasAlignment() || (GetAlignment() == attr.GetAlignment())) &&
GetLeftIndent() == attr.GetLeftIndent() && (!HasLeftIndent() || (GetLeftIndent() == attr.GetLeftIndent() &&
GetLeftSubIndent() == attr.GetLeftSubIndent() && GetLeftSubIndent() == attr.GetLeftSubIndent())) &&
GetRightIndent() == attr.GetRightIndent() && (!HasRightIndent() || (GetRightIndent() == attr.GetRightIndent())) &&
TabsEq(GetTabs(), attr.GetTabs()) && (!HasTabs() || (TabsEq(GetTabs(), attr.GetTabs()))) &&
GetParagraphSpacingAfter() == attr.GetParagraphSpacingAfter() && (!HasParagraphSpacingAfter() || (GetParagraphSpacingAfter() == attr.GetParagraphSpacingAfter())) &&
GetParagraphSpacingBefore() == attr.GetParagraphSpacingBefore() && (!HasParagraphSpacingBefore() || (GetParagraphSpacingBefore() == attr.GetParagraphSpacingBefore())) &&
GetLineSpacing() == attr.GetLineSpacing() && (!HasLineSpacing() || (GetLineSpacing() == attr.GetLineSpacing())) &&
GetCharacterStyleName() == attr.GetCharacterStyleName() && (!HasCharacterStyleName() || (GetCharacterStyleName() == attr.GetCharacterStyleName())) &&
GetParagraphStyleName() == attr.GetParagraphStyleName() && (!HasParagraphStyleName() || (GetParagraphStyleName() == attr.GetParagraphStyleName())) &&
GetListStyleName() == attr.GetListStyleName() && (!HasListStyleName() || (GetListStyleName() == attr.GetListStyleName())) &&
GetBulletStyle() == attr.GetBulletStyle() && (!HasBulletStyle() || (GetBulletStyle() == attr.GetBulletStyle())) &&
GetBulletText() == attr.GetBulletText() && (!HasBulletText() || (GetBulletText() == attr.GetBulletText())) &&
GetBulletNumber() == attr.GetBulletNumber() && (!HasBulletNumber() || (GetBulletNumber() == attr.GetBulletNumber())) &&
GetBulletFont() == attr.GetBulletFont() && (GetBulletFont() == attr.GetBulletFont()) &&
GetBulletName() == attr.GetBulletName() && (!HasBulletName() || (GetBulletName() == attr.GetBulletName())) &&
GetTextEffects() == attr.GetTextEffects() && (!HasTextEffects() || (GetTextEffects() == attr.GetTextEffects() &&
GetTextEffectFlags() == attr.GetTextEffectFlags() && GetTextEffectFlags() == attr.GetTextEffectFlags())) &&
GetOutlineLevel() == attr.GetOutlineLevel() && (!HasOutlineLevel() || (GetOutlineLevel() == attr.GetOutlineLevel())) &&
GetFontSize() == attr.GetFontSize() && (!HasFontSize() || (GetFontSize() == attr.GetFontSize())) &&
GetFontStyle() == attr.GetFontStyle() && (!HasFontItalic() || (GetFontStyle() == attr.GetFontStyle())) &&
GetFontWeight() == attr.GetFontWeight() && (!HasFontWeight() || (GetFontWeight() == attr.GetFontWeight())) &&
GetFontUnderlined() == attr.GetFontUnderlined() && (!HasFontUnderlined() || (GetFontUnderlined() == attr.GetFontUnderlined())) &&
GetFontFaceName() == attr.GetFontFaceName() && (!HasFontStrikethrough() || (GetFontStrikethrough() == attr.GetFontStrikethrough())) &&
GetFontEncoding() == attr.GetFontEncoding() && (!HasFontFaceName() || (GetFontFaceName() == attr.GetFontFaceName())) &&
GetFontFamily() == attr.GetFontFamily() && (!HasFontEncoding() || (GetFontEncoding() == attr.GetFontEncoding())) &&
(!HasFontFamily() || (GetFontFamily() == attr.GetFontFamily())) &&
GetURL() == attr.GetURL(); (!HasURL() || (GetURL() == attr.GetURL()));
} }
// Partial equality test. Only returns false if an attribute doesn't match. // Partial equality test. Only returns false if an attribute doesn't match.