summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2013-01-10 14:06:46 +0000
committerChristopher Michael <cpmichael1@comcast.net>2013-01-10 14:06:46 +0000
commit0faaf7b7b5d8275aff4cfb89312a3a3e94dbd96d (patch)
tree6ee1c728ac4c8f68d87c06fb88c8b8f20d471834
parentb70730ca6dcf2b77e6dcccd2fc0d1b746e0ad704 (diff)
Do not try to get the genlist Smart_Data from the data pointer in
show_region_hook, but rather get it from the actual Object. Fixes a crash that happens if someone overrides the show_region_hook (via elm_widget call) and passes an Int or String or something else as the data parameter. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 82571
-rw-r--r--src/lib/elm_genlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 176da806b..f89bf518b 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2528,12 +2528,12 @@ _elm_genlist_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
2528/* FIXME: take off later. maybe this show region coords belong in the 2528/* FIXME: take off later. maybe this show region coords belong in the
2529 * interface (new api functions, set/get)? */ 2529 * interface (new api functions, set/get)? */
2530static void 2530static void
2531_show_region_hook(void *data, 2531_show_region_hook(void *data EINA_UNUSED,
2532 Evas_Object *obj) 2532 Evas_Object *obj)
2533{ 2533{
2534 Evas_Coord x, y, w, h; 2534 Evas_Coord x, y, w, h;
2535 2535
2536 ELM_GENLIST_DATA_GET(data, sd); 2536 ELM_GENLIST_DATA_GET_OR_RETURN(obj, sd);
2537 2537
2538 elm_widget_show_region_get(obj, &x, &y, &w, &h); 2538 elm_widget_show_region_get(obj, &x, &y, &w, &h);
2539 //x & y are screen coordinates, Add with pan coordinates 2539 //x & y are screen coordinates, Add with pan coordinates
@@ -4624,7 +4624,7 @@ _elm_genlist_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
4624 evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE); 4624 evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
4625 4625
4626 elm_widget_can_focus_set(obj, EINA_TRUE); 4626 elm_widget_can_focus_set(obj, EINA_TRUE);
4627 elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj); 4627 elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL);
4628 4628
4629 priv->generation = 1; 4629 priv->generation = 1;
4630 4630