Corrected collection of common attributes, for clashing font size units.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12411,34 +12411,44 @@ void wxTextAttrCollectCommonAttributes(wxTextAttr& currentStyle, const wxTextAtt
|
|||||||
|
|
||||||
if (attr.HasFont())
|
if (attr.HasFont())
|
||||||
{
|
{
|
||||||
if (attr.HasFontPointSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_POINT_SIZE))
|
// If different font size units are being used, this is a clash.
|
||||||
|
if (((attr.GetFlags() & wxTEXT_ATTR_FONT_SIZE) | (currentStyle.GetFlags() & wxTEXT_ATTR_FONT_SIZE)) == wxTEXT_ATTR_FONT_SIZE)
|
||||||
{
|
{
|
||||||
if (currentStyle.HasFontPointSize())
|
currentStyle.SetFontSize(0);
|
||||||
{
|
currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_SIZE);
|
||||||
if (currentStyle.GetFontSize() != attr.GetFontSize())
|
clashingAttr.AddFlag(wxTEXT_ATTR_FONT_SIZE);
|
||||||
{
|
|
||||||
// Clash of attr - mark as such
|
|
||||||
clashingAttr.AddFlag(wxTEXT_ATTR_FONT_POINT_SIZE);
|
|
||||||
currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_POINT_SIZE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
currentStyle.SetFontSize(attr.GetFontSize());
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (attr.HasFontPixelSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_PIXEL_SIZE))
|
|
||||||
{
|
{
|
||||||
if (currentStyle.HasFontPixelSize())
|
if (attr.HasFontPointSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_POINT_SIZE))
|
||||||
{
|
{
|
||||||
if (currentStyle.GetFontSize() != attr.GetFontSize())
|
if (currentStyle.HasFontPointSize())
|
||||||
{
|
{
|
||||||
// Clash of attr - mark as such
|
if (currentStyle.GetFontSize() != attr.GetFontSize())
|
||||||
clashingAttr.AddFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE);
|
{
|
||||||
currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE);
|
// Clash of attr - mark as such
|
||||||
|
clashingAttr.AddFlag(wxTEXT_ATTR_FONT_POINT_SIZE);
|
||||||
|
currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_POINT_SIZE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
currentStyle.SetFontSize(attr.GetFontSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attr.HasFontPixelSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_PIXEL_SIZE))
|
||||||
|
{
|
||||||
|
if (currentStyle.HasFontPixelSize())
|
||||||
|
{
|
||||||
|
if (currentStyle.GetFontSize() != attr.GetFontSize())
|
||||||
|
{
|
||||||
|
// Clash of attr - mark as such
|
||||||
|
clashingAttr.AddFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE);
|
||||||
|
currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
currentStyle.SetFontPixelSize(attr.GetFontSize());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
currentStyle.SetFontPixelSize(attr.GetFontSize());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr.HasFontItalic() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_ITALIC))
|
if (attr.HasFontItalic() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_ITALIC))
|
||||||
|
Reference in New Issue
Block a user