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

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

Issue 8827007: Fix a FORWARD_NULL defect reported by Coverity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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: ui/views/controls/scroll_view.cc
===================================================================
--- ui/views/controls/scroll_view.cc (revision 112997)
+++ ui/views/controls/scroll_view.cc (working copy)
@@ -262,17 +262,15 @@
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());
}
void ScrollView::ScrollContentsRegionToBeVisible(const gfx::Rect& rect) {
- 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 =
« 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