seoz pushed a commit to branch master.
commit 301f7804469604473000d384070c76d4763a8fbd
Author: Daniel Juyung Seo <[email protected]>
Date: Mon Sep 9 19:15:26 2013 +0900
elc_popup.c: theck elm_layout_theme_set() return value.
- Handle successive code accordingly.
- This fixes coverity CID 1086781 and 1086782.
---
src/lib/elc_popup.c | 58 ++++++++++++++++++++++++++++++++---------------------
1 file changed, 35 insertions(+), 23 deletions(-)
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index 6532b7a..767b32c 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -357,22 +357,29 @@ _elm_popup_smart_theme(Eo *obj, void *_pd, va_list *list)
{
EINA_LIST_FOREACH(sd->items, elist, it)
{
- elm_layout_theme_set
- (VIEW(it), "popup", "item", elm_widget_style_get(obj));
- if (it->label)
+ if (!elm_layout_theme_set
+ (VIEW(it), "popup", "item", elm_widget_style_get(obj)))
+ CRITICAL("Failed to set layout!");
+ else
{
- elm_layout_text_set(VIEW(it), "elm.text", it->label);
- elm_layout_signal_emit(VIEW(it),
- "elm,state,item,text,visible", "elm");
+ if (it->label)
+ {
+ elm_layout_text_set(VIEW(it), "elm.text", it->label);
+ elm_layout_signal_emit(VIEW(it),
+ "elm,state,item,text,visible",
+ "elm");
+ }
+ if (it->icon)
+ elm_layout_signal_emit(VIEW(it),
+ "elm,state,item,icon,visible",
+ "elm");
+ if (it->disabled)
+ elm_layout_signal_emit(VIEW(it),
+ "elm,state,item,disabled", "elm");
+ evas_object_show(VIEW(it));
+ edje_object_message_signal_process(
+ elm_layout_edje_get(VIEW(it)));
}
- if (it->icon)
- elm_layout_signal_emit(VIEW(it),
- "elm,state,item,icon,visible", "elm");
- if (it->disabled)
- elm_layout_signal_emit(VIEW(it),
- "elm,state,item,disabled", "elm");
- evas_object_show(VIEW(it));
- edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
}
_scroller_size_calc(obj);
}
@@ -854,12 +861,16 @@ _item_new(Elm_Popup_Item *it)
elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
VIEW(it) = elm_layout_add(WIDGET(it));
- elm_layout_theme_set(VIEW(it), "popup", "item",
- elm_widget_style_get(WIDGET(it)));
- elm_layout_signal_callback_add(VIEW(it), "elm,action,click", "",
- _item_select_cb, it);
- evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(VIEW(it));
+ if (!elm_layout_theme_set(VIEW(it), "popup", "item",
+ elm_widget_style_get(WIDGET(it))))
+ CRITICAL("Failed to set layout!");
+ else
+ {
+ elm_layout_signal_callback_add(VIEW(it), "elm,action,click", "",
+ _item_select_cb, it);
+ evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL,
EVAS_HINT_FILL);
+ evas_object_show(VIEW(it));
+ }
}
static Eina_Bool
@@ -1519,9 +1530,10 @@ _elm_popup_smart_add(Eo *obj, void *_pd, va_list *list
EINA_UNUSED)
if (!elm_layout_theme_set
(priv->content_area, "popup", "content", elm_widget_style_get(obj)))
CRITICAL("Failed to set layout!");
- evas_object_event_callback_add
- (priv->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _size_hints_changed_cb, obj);
+ else
+ evas_object_event_callback_add
+ (priv->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _size_hints_changed_cb, obj);
priv->content_text_wrap_type = ELM_WRAP_MIXED;
evas_object_smart_callback_add
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk