]> git.saurik.com Git - wxWidgets.git/commitdiff
No changes, just remove unnecessary wxTextAttr tests.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Nov 2012 23:52:43 +0000 (23:52 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Nov 2012 23:52:43 +0000 (23:52 +0000)
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

src/osx/cocoa/textctrl.mm

index fd5431010829da800c3be52c3fe7a78d0c96ab2c..e68590a4dbaefe2ce5290c506048c720a6040895 100644 (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];
     }
 }