Chromium Code Reviews| Index: ui/views/controls/styled_label.cc |
| diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc |
| index 24d9862c87ccc30b3ced727b11fafe47e687a783..6c76fee18d5dc3fe47e7884913313e5366964776 100644 |
| --- a/ui/views/controls/styled_label.cc |
| +++ b/ui/views/controls/styled_label.cc |
| @@ -157,9 +157,18 @@ gfx::Insets StyledLabel::GetInsets() const { |
| return insets; |
| } |
| -int StyledLabel::GetHeightForWidth(int w) { |
| - if (w != calculated_size_.width()) |
| - calculated_size_ = CalculateAndDoLayout(w, true); |
| +int StyledLabel::GetHeightForWidth(int w) const { |
| + if (w != calculated_size_.width()) { |
| + // TODO(erg): Munge the const-ness of the style label. CalculateAndDoLayout |
| + // doesn't actually make any changes to member variables when |dry_run| is |
| + // set to true. In general, the mutating and non-mutating parts shouldn't |
| + // be in the same codepath. |
| + // |
| + // I only feel OK about this quick hack since this code is going away |
|
sky
2014/05/13 16:13:57
Why is this code going away?
Elliot Glaysher
2014/05/14 00:48:58
I actually got the wrong impression from msw@. Thi
|
| + // anyway? |
| + calculated_size_ = |
| + const_cast<StyledLabel*>(this)->CalculateAndDoLayout(w, true); |
| + } |
| return calculated_size_.height(); |
| } |