Fixed Prevent issues:18071,18926,18925
authorRajeev Ranjan <rajeev.r@samsung.com>
Sat, 15 Oct 2011 09:25:39 +0000 (14:55 +0530)
committerRajeev Ranjan <rajeev.r@samsung.com>
Fri, 11 Nov 2011 06:53:38 +0000 (12:23 +0530)
Change-Id: Ie35a53376e8f416d22bf3a9f9f2e62ee560cdc0f

src/lib/elm_genlist.c

index 3cefcb5..09e83c4 100644 (file)
@@ -707,14 +707,11 @@ _sizing_eval(Evas_Object *obj)
      }
    if (wd->mode == ELM_LIST_LIMIT)
      {
-        Evas_Coord vmw, vmh, vw, vh;
+        Evas_Coord vmw, vmh;
 
         minw = wd->realminw;
         maxw = -1;
-        elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
-        if ((minw > 0) && (vw < minw)) vw = minw;
-        else if ((maxw > 0) && (vw > maxw))
-          vw = maxw;
+        elm_smart_scroller_child_viewport_size_get(wd->scr, &vmw, &vmh);
         edje_object_size_min_calc
           (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
         minw = vmw + minw;
@@ -3962,11 +3959,10 @@ elm_genlist_item_insert_after(Evas_Object                  *obj,
    EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
    Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
                                     func_data);
    if (!it) return NULL;
-   /* It makes no sense to insert after in an empty list with after != NULL, something really bad is happening in your app. */
-   EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
 
    if (!it->parent)
      {
@@ -4003,11 +3999,10 @@ elm_genlist_item_insert_before(Evas_Object                  *obj,
    EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
    Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
                                     func_data);
    if (!it) return NULL;
-   /* It makes no sense to insert before in an empty list with before != NULL, something really bad is happening in your app. */
-   EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
 
    if (!it->parent)
      {