No changes, just remove unnecessary wxTextAttr tests.

If wxTextAttr::HasFoo() returns true, there is no need to test for
GetFoo().IsOk().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-11-04 23:52:43 +00:00
parent 529f35ff37
commit dfc9124f08

View File

@@ -694,18 +694,14 @@ void wxNSTextViewControl::SetStyle(long start,
range = [m_textView selectedRange];
NSTextStorage* storage = [m_textView textStorage];
if ( style.HasFont() )
[storage addAttribute:NSFontAttributeName value:style.GetFont().OSXGetNSFont() range:range];
if ( style.HasBackgroundColour() )
[storage addAttribute:NSBackgroundColorAttributeName value:style.GetBackgroundColour().OSXGetNSColor() range:range];
wxFont font = style.GetFont();
if (style.HasFont() && font.IsOk())
[storage addAttribute:NSFontAttributeName value:font.OSXGetNSFont() range:range];
wxColour bgcolor = style.GetBackgroundColour();
if (style.HasBackgroundColour() && bgcolor.IsOk())
[storage addAttribute:NSBackgroundColorAttributeName value:bgcolor.OSXGetNSColor() range:range];
wxColour fgcolor = style.GetTextColour();
if (style.HasTextColour() && fgcolor.IsOk())
[storage addAttribute:NSForegroundColorAttributeName value:fgcolor.OSXGetNSColor() range:range];
if ( style.HasTextColour() )
[storage addAttribute:NSForegroundColorAttributeName value:style.GetTextColour().OSXGetNSColor() range:range];
}
}