Corrections to attribute manipulation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2014-02-27 10:03:53 +00:00
parent bc5b91cb7c
commit f631f732af
2 changed files with 48 additions and 0 deletions

View File

@@ -392,6 +392,12 @@ bool wxTextAttr::EqPartial(const wxTextAttr& attr, bool weakTest) const
if ((HasPageBreak() != attr.HasPageBreak()))
return false;
if ((GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE) != (attr.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE))
return false;
if ((GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER) != (attr.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER))
return false;
if (HasTextEffects() && attr.HasTextEffects())
{
if (!BitlistsEqPartial(GetTextEffects(), attr.GetTextEffects(), GetTextEffectFlags()))
@@ -705,6 +711,18 @@ bool wxTextAttr::Apply(const wxTextAttr& style, const wxTextAttr* compareWith)
destStyle.SetPageBreak();
}
if (style.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE)
{
if (!(compareWith && (compareWith->GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE)))
destStyle.SetFlags(destStyle.GetFlags()|wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE);
}
if (style.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER)
{
if (!(compareWith && (compareWith->GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER)))
destStyle.SetFlags(destStyle.GetFlags()|wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER);
}
if (style.HasTextEffects())
{
if (!(compareWith && compareWith->HasTextEffects() && compareWith->GetTextEffects() == style.GetTextEffects()))