Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2203)

Unified Diff: ui/views/controls/link.cc

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify OmniboxResultView; Rename StyleBreak; cleanup. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/link.cc
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index 04c83ac3af628bce83147af1514656a4ca576ae8..1397e38471db0f34dd187d06fef5ae69b5d1a17f 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -204,13 +204,11 @@ void Link::SetPressed(bool pressed) {
}
void Link::RecalculateFont() {
- // The font should be underlined iff the link is enabled and |underline_| is
- // true.
- if ((enabled() && underline_) ==
- !(font().GetStyle() & gfx::Font::UNDERLINED)) {
+ // Set an underline iff the link is enabled and |underline_| is true.
+ if ((enabled() && underline_) != (font().GetStyle() & gfx::Font::UNDERLINE)) {
Alexei Svitkine (slow) 2013/01/22 19:20:21 This is not correct. The result of (font().GetSty
msw 2013/01/22 22:27:24 Adjusted, thanks for the catch (worked trivially i
Label::SetFont(font().DeriveFont(0, enabled() && underline_ ?
- (font().GetStyle() | gfx::Font::UNDERLINED) :
- (font().GetStyle() & ~gfx::Font::UNDERLINED)));
+ (font().GetStyle() | gfx::Font::UNDERLINE) :
+ (font().GetStyle() & ~gfx::Font::UNDERLINE)));
}
}

Powered by Google App Engine
This is Rietveld 408576698