diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-19 02:42:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-19 02:42:43 +0400 |
commit | 32896bbf591e71486d8ca643ca9436ce6d145f2f (patch) | |
tree | 3e32db79e604419bab3abcb74a6759032c48ed51 /source/blender/editors/interface | |
parent | 65f2cbdd0f23df6b3575e8d61ef59bfb71cc4932 (diff) |
remove unneeded NULL check in ui_searchbox_create() which confuses static checkers since the values used later.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 23 |
1 files changed, 11 insertions, 12 deletions
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; |