elm_genlist.c: return "elm.swallow.icon" part's object when the part parameter is...
authorDaniel Juyung Seo <juyung.seo@samsung.com>
Sat, 30 Nov 2013 09:28:47 +0000 (18:28 +0900)
committerDaniel Juyung Seo <juyung.seo@samsung.com>
Sat, 30 Nov 2013 09:28:47 +0000 (18:28 +0900)
Now elm_object_item_content_get() works fine.
+ avoid ambiguous if-else statement by using braces.

legacy/elementary/src/lib/elm_genlist.c

index 19d76e3..c432419 100644 (file)
@@ -5202,7 +5202,12 @@ _item_content_get_hook(Elm_Gen_Item *it,
    else if (it->decorate_it_set)
      ret = edje_object_part_swallow_get(it->item->deco_it_view, part);
    if (!ret)
-     ret = edje_object_part_swallow_get(VIEW(it), part);
+     {
+        if (part)
+          ret = edje_object_part_swallow_get(VIEW(it), part);
+        else
+          ret = edje_object_part_swallow_get(VIEW(it), "elm.swallow.icon");
+     }
    return ret;
 }
 
@@ -5217,10 +5222,12 @@ _item_text_get_hook(Elm_Gen_Item *it,
    else if (it->decorate_it_set)
      ret = edje_object_part_text_get(it->item->deco_it_view, part);
    if (!ret)
-     if (part)
-       ret = edje_object_part_text_get(VIEW(it), part);
-     else
-       ret = edje_object_part_text_get(VIEW(it), "elm.text");
+     {
+        if (part)
+          ret = edje_object_part_text_get(VIEW(it), part);
+        else
+          ret = edje_object_part_text_get(VIEW(it), "elm.text");
+     }
    return ret;
 }