Corrected bugs with text effects comparison and style removal
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4de86c0b26
commit
8e3bbb68f0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user