From 306e7f9a2752e1714d849f89bad1770a7d540441 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 21 Jul 2011 20:54:54 +0000 Subject: [PATCH] some logic/indent reformatting SVN revision: 61568 --- legacy/elementary/src/lib/elm_entry.c | 72 +++++++++++++-------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c index 5960bfdda1..a86041b96b 100644 --- a/legacy/elementary/src/lib/elm_entry.c +++ b/legacy/elementary/src/lib/elm_entry.c @@ -1425,52 +1425,50 @@ _signal_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emis Widget_Data *wd = elm_widget_data_get(data); Elm_Entry_Anchor_Info ei; char *buf2, *p, *p2, *n; + const Eina_List *geoms; if (!wd) return; p = strrchr(emission, ','); - if (p) + if (!p) return; + + n = p + 1; + p2 = p -1; + while (p2 >= emission) { - const Eina_List *geoms; + if (*p2 == ',') break; + p2--; + } + p2++; + buf2 = alloca(5 + p - p2); + strncpy(buf2, p2, p - p2); + buf2[p - p2] = 0; + ei.name = n; + ei.button = atoi(buf2); + ei.x = ei.y = ei.w = ei.h = 0; + geoms = + edje_object_part_text_anchor_geometry_get(wd->ent, "elm.text", ei.name); + if (geoms) + { + Evas_Textblock_Rectangle *r; + const Eina_List *l; + Evas_Coord px, py, x, y; - n = p + 1; - p2 = p -1; - while (p2 >= emission) + evas_object_geometry_get(wd->ent, &x, &y, NULL, NULL); + evas_pointer_canvas_xy_get(evas_object_evas_get(wd->ent), &px, &py); + EINA_LIST_FOREACH(geoms, l, r) { - if (*p2 == ',') break; - p2--; - } - p2++; - buf2 = alloca(5 + p - p2); - strncpy(buf2, p2, p - p2); - buf2[p - p2] = 0; - ei.name = n; - ei.button = atoi(buf2); - ei.x = ei.y = ei.w = ei.h = 0; - geoms = - edje_object_part_text_anchor_geometry_get(wd->ent, "elm.text", ei.name); - if (geoms) - { - Evas_Textblock_Rectangle *r; - const Eina_List *l; - Evas_Coord px, py, x, y; - - evas_object_geometry_get(wd->ent, &x, &y, NULL, NULL); - evas_pointer_canvas_xy_get(evas_object_evas_get(wd->ent), &px, &py); - EINA_LIST_FOREACH(geoms, l, r) + if (((r->x + x) <= px) && ((r->y + y) <= py) && + ((r->x + x + r->w) > px) && ((r->y + y + r->h) > py)) { - if (((r->x + x) <= px) && ((r->y + y) <= py) && - ((r->x + x + r->w) > px) && ((r->y + y + r->h) > py)) - { - ei.x = r->x + x; - ei.y = r->y + y; - ei.w = r->w; - ei.h = r->h; - break; - } + ei.x = r->x + x; + ei.y = r->y + y; + ei.w = r->w; + ei.h = r->h; + break; } } - if (!wd->disabled) - evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei); } + if (!wd->disabled) + evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei); } static void