Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_box.c Log Message: add extra checks for null returns =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_box.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- e_box.c 7 Jan 2006 10:39:45 -0000 1.14 +++ e_box.c 13 Mar 2006 06:59:13 -0000 1.15 @@ -419,13 +419,16 @@ obj = l->data; bi = evas_object_data_get(obj, "e_box_data"); - if (sd->horizontal) - { - if (bi->expand_w) expand++; - } - else + if (bi) { - if (bi->expand_h) expand++; + if (sd->horizontal) + { + if (bi->expand_w) expand++; + } + else + { + if (bi->expand_h) expand++; + } } } if (expand == 0) @@ -452,96 +455,99 @@ obj = l->data; bi = evas_object_data_get(obj, "e_box_data"); - if (sd->horizontal) + if (bi) { - if (sd->homogenous) - { - Evas_Coord ww, hh, ow, oh; - - ww = (w / (Evas_Coord)count); - hh = h; - ow = bi->min.w; - if (bi->fill_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->fill_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - evas_object_move(obj, - xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), - yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); - evas_object_resize(obj, ow, oh); - xx += ww; - } - else + if (sd->horizontal) { - Evas_Coord ww, hh, ow, oh; - - ww = bi->min.w; - if ((expand > 0) && (bi->expand_w)) + if (sd->homogenous) { - if (expand == 1) ow = wdif; - else ow = (w - minw) / expand; - wdif -= ow; - ww += ow; + Evas_Coord ww, hh, ow, oh; + + ww = (w / (Evas_Coord)count); + hh = h; + ow = bi->min.w; + if (bi->fill_w) ow = ww; + if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; + oh = bi->min.h; + if (bi->fill_h) oh = hh; + if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; + evas_object_move(obj, + xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), + yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); + evas_object_resize(obj, ow, oh); + xx += ww; + } + else + { + Evas_Coord ww, hh, ow, oh; + + ww = bi->min.w; + if ((expand > 0) && (bi->expand_w)) + { + if (expand == 1) ow = wdif; + else ow = (w - minw) / expand; + wdif -= ow; + ww += ow; + } + hh = h; + ow = bi->min.w; + if (bi->fill_w) ow = ww; + if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; + oh = bi->min.h; + if (bi->fill_h) oh = hh; + if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; + evas_object_move(obj, + xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), + yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); + evas_object_resize(obj, ow, oh); + xx += ww; } - hh = h; - ow = bi->min.w; - if (bi->fill_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->fill_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - evas_object_move(obj, - xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), - yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); - evas_object_resize(obj, ow, oh); - xx += ww; - } - } - else - { - if (sd->homogenous) - { - Evas_Coord ww, hh, ow, oh; - - ww = w; - hh = (h / (Evas_Coord)count); - ow = bi->min.w; - if (bi->expand_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->expand_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - evas_object_move(obj, - xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), - yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); - evas_object_resize(obj, ow, oh); - yy += hh; } else { - Evas_Coord ww, hh, ow, oh; - - ww = w; - hh = bi->min.h; - if ((expand > 0) && (bi->expand_h)) + if (sd->homogenous) + { + Evas_Coord ww, hh, ow, oh; + + ww = w; + hh = (h / (Evas_Coord)count); + ow = bi->min.w; + if (bi->expand_w) ow = ww; + if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; + oh = bi->min.h; + if (bi->expand_h) oh = hh; + if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; + evas_object_move(obj, + xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), + yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); + evas_object_resize(obj, ow, oh); + yy += hh; + } + else { - if (expand == 1) oh = hdif; - else oh = (h - minh) / expand; - hdif -= oh; - hh += oh; + Evas_Coord ww, hh, ow, oh; + + ww = w; + hh = bi->min.h; + if ((expand > 0) && (bi->expand_h)) + { + if (expand == 1) oh = hdif; + else oh = (h - minh) / expand; + hdif -= oh; + hh += oh; + } + ow = bi->min.w; + if (bi->expand_w) ow = ww; + if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; + oh = bi->min.h; + if (bi->expand_h) oh = hh; + if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; + evas_object_move(obj, + xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), + yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); + evas_object_resize(obj, ow, oh); + yy += hh; } - ow = bi->min.w; - if (bi->expand_w) ow = ww; - if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w; - oh = bi->min.h; - if (bi->expand_h) oh = hh; - if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h; - evas_object_move(obj, - xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x), - yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y)); - evas_object_resize(obj, ow, oh); - yy += hh; } } } @@ -569,15 +575,18 @@ obj = l->data; bi = evas_object_data_get(obj, "e_box_data"); - if (sd->horizontal) - { - if (minh < bi->min.h) minh = bi->min.h; - if (minw < bi->min.w) minw = bi->min.w; - } - else + if (bi) { - if (minw < bi->min.w) minw = bi->min.w; - if (minh < bi->min.h) minh = bi->min.h; + if (sd->horizontal) + { + if (minh < bi->min.h) minh = bi->min.h; + if (minw < bi->min.w) minw = bi->min.w; + } + else + { + if (minw < bi->min.w) minw = bi->min.w; + if (minh < bi->min.h) minh = bi->min.h; + } } } if (sd->horizontal) @@ -597,16 +606,19 @@ Evas_Object *obj; obj = l->data; - bi = evas_object_data_get(obj, "e_box_data"); - if (sd->horizontal) - { - if (minh < bi->min.h) minh = bi->min.h; - minw += bi->min.w; - } - else + bi = evas_object_data_get(obj, "e_box_data"); + if (bi) { - if (minw < bi->min.w) minw = bi->min.w; - minh += bi->min.h; + if (sd->horizontal) + { + if (minh < bi->min.h) minh = bi->min.h; + minw += bi->min.w; + } + else + { + if (minw < bi->min.w) minw = bi->min.w; + minh += bi->min.h; + } } } } ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs