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

Unified Diff: views/controls/scroll_view.cc

Issue 155980: Fix a FORWARD_NULL defect reported by Coverity.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/scroll_view.cc
===================================================================
--- views/controls/scroll_view.cc (revision 21299)
+++ views/controls/scroll_view.cc (working copy)
@@ -261,9 +261,9 @@
return gfx::Rect();
const int x =
- (horiz_sb_ && horiz_sb_->IsVisible()) ? horiz_sb_->GetPosition() : 0;
+ horiz_sb_->IsVisible() ? horiz_sb_->GetPosition() : 0;
const int y =
- (vert_sb_ && vert_sb_->IsVisible()) ? vert_sb_->GetPosition() : 0;
+ vert_sb_->IsVisible() ? vert_sb_->GetPosition() : 0;
return gfx::Rect(x, y, viewport_->width(), viewport_->height());
}
@@ -271,10 +271,8 @@
int y,
int width,
int height) {
- if (!contents_ || ((!horiz_sb_ || !horiz_sb_->IsVisible()) &&
- (!vert_sb_ || !vert_sb_->IsVisible()))) {
+ if (!contents_ || (!horiz_sb_->IsVisible() && !vert_sb_->IsVisible()))
return;
- }
// Figure out the maximums for this scroll view.
const int contents_max_x =
@@ -337,7 +335,7 @@
}
}
-// TODO(ACW). We should really use ScrollWindowEx as needed
+// TODO(ACW): We should really use ScrollWindowEx as needed
void ScrollView::ScrollToPosition(ScrollBar* source, int position) {
if (!contents_)
return;
@@ -502,7 +500,7 @@
: VariableRowHeightScrollHelper(NULL),
top_margin_(top_margin),
row_height_(row_height) {
- DCHECK(row_height > 0);
+ DCHECK_GT(row_height, 0);
}
VariableRowHeightScrollHelper::RowInfo
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698