Corrected bugs with text effects comparison and style removal

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2013-11-21 15:25:53 +00:00
parent b4900d9341
commit 602a0d1260

View File

@@ -393,7 +393,7 @@ bool wxTextAttr::EqPartial(const wxTextAttr& attr, bool weakTest) const
if (HasTextEffects() && attr.HasTextEffects())
{
if (!BitlistsEqPartial(GetTextEffects(), attr.GetTextEffects(), attr.GetTextEffectFlags()))
if (!BitlistsEqPartial(GetTextEffects(), attr.GetTextEffects(), GetTextEffectFlags()))
return false;
}
@@ -817,6 +817,19 @@ bool wxTextAttr::RemoveStyle(wxTextAttr& destStyle, const wxTextAttr& style)
int flags = style.GetFlags();
int destFlags = destStyle.GetFlags();
// We must treat text effects specially, since we must remove only some.
if (style.HasTextEffects() && (style.GetTextEffectFlags() != 0))
{
int newTextEffectFlags = destStyle.GetTextEffectFlags() & ~style.GetTextEffectFlags();
int newTextEffects = destStyle.GetTextEffects() & ~style.GetTextEffectFlags();
destStyle.SetTextEffects(newTextEffects);
destStyle.SetTextEffectFlags(newTextEffectFlags);
// Don't remove wxTEXT_ATTR_EFFECTS unless the resulting flags are zero
if (newTextEffectFlags != 0)
flags &= ~wxTEXT_ATTR_EFFECTS;
}
destStyle.SetFlags(destFlags & ~flags);
return true;