From 32896bbf591e71486d8ca643ca9436ce6d145f2f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 18 Dec 2011 22:42:43 +0000 Subject: remove unneeded NULL check in ui_searchbox_create() which confuses static checkers since the values used later. --- .../blender/editors/interface/interface_regions.c | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/interface') diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index b89a80bb0d7..c535f2c1ad0 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1071,18 +1071,16 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) /* copy to int, gets projected if possible too */ x1= x1f; y1= y1f; x2= x2f; y2= y2f; - if(butregion) { - if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) { - UI_view2d_to_region_no_clip(&butregion->v2d, x1f, y1f, &x1, &y1); - UI_view2d_to_region_no_clip(&butregion->v2d, x2f, y2f, &x2, &y2); - } - - x1 += butregion->winrct.xmin; - x2 += butregion->winrct.xmin; - y1 += butregion->winrct.ymin; - y2 += butregion->winrct.ymin; + if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) { + UI_view2d_to_region_no_clip(&butregion->v2d, x1f, y1f, &x1, &y1); + UI_view2d_to_region_no_clip(&butregion->v2d, x2f, y2f, &x2, &y2); } - + + x1 += butregion->winrct.xmin; + x2 += butregion->winrct.xmin; + y1 += butregion->winrct.ymin; + y2 += butregion->winrct.ymin; + wm_window_get_size(CTX_wm_window(C), &winx, &winy); if(x2 > winx) { @@ -1096,7 +1094,8 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) x2= winx; } } - if(y1 < 0) { /* XXX butregion NULL check?, there is one above */ + + if(y1 < 0) { int newy1; UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->y2 + ofsy, NULL, &newy1); newy1 += butregion->winrct.ymin; -- cgit v1.2.3