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:
parent
bc5b91cb7c
commit
f631f732af
@ -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()))
|
||||
|
@ -14445,6 +14445,36 @@ void wxTextAttrCollectCommonAttributes(wxTextAttr& currentStyle, const wxTextAtt
|
||||
currentStyle.RemoveFlag(wxTEXT_ATTR_LINE_SPACING);
|
||||
}
|
||||
|
||||
if (attr.HasPageBreak() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_PAGE_BREAK))
|
||||
{
|
||||
currentStyle.SetPageBreak(true);
|
||||
}
|
||||
else if (!attr.HasPageBreak() && currentStyle.HasPageBreak())
|
||||
{
|
||||
clashingAttr.AddFlag(wxTEXT_ATTR_PAGE_BREAK);
|
||||
currentStyle.RemoveFlag(wxTEXT_ATTR_PAGE_BREAK);
|
||||
}
|
||||
|
||||
if ((attr.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE) && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE))
|
||||
{
|
||||
currentStyle.AddFlag(wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE);
|
||||
}
|
||||
else if (!(attr.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE) && (currentStyle.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE))
|
||||
{
|
||||
clashingAttr.AddFlag(wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE);
|
||||
currentStyle.RemoveFlag(wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE);
|
||||
}
|
||||
|
||||
if ((attr.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER) && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER))
|
||||
{
|
||||
currentStyle.AddFlag(wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER);
|
||||
}
|
||||
else if (!(attr.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER) && (currentStyle.GetFlags() & wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER))
|
||||
{
|
||||
clashingAttr.AddFlag(wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER);
|
||||
currentStyle.RemoveFlag(wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER);
|
||||
}
|
||||
|
||||
if (attr.HasCharacterStyleName() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_CHARACTER_STYLE_NAME))
|
||||
{
|
||||
if (currentStyle.HasCharacterStyleName())
|
||||
|
Loading…
Reference in New Issue
Block a user