From: Shinwoo Kim Date: Mon, 11 Sep 2017 05:29:46 +0000 (+0900) Subject: atspi: follow edje_entry logic to send anchor name X-Git-Tag: submit/tizen_3.0/20171019.130042~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F148875%2F2;p=platform%2Fupstream%2Felementary.git atspi: follow edje_entry logic to send anchor name The edje_entry has logic remove unnecessary character. The elm_entry is following the logic to give correct information. Change-Id: I55114193d9b23117ddc8b9863c2b14741f42a215 --- diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 872362f27..a484d7f89 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -8189,6 +8189,47 @@ _anchor_rect_activated_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_ evas_object_smart_callback_call(entry, SIG_ANCHOR_CLICKED, &ei); } +static char * +_anchor_format_parse(const char *item) +{ + const char *start, *end; + char *tmp; + size_t len; + + start = strchr(item, '='); + if (!start) return NULL; + + start++; /* Advance after the '=' */ + /* If we can find a quote as the first non-space char, + * our new delimiter is a quote, not a space. */ + while (*start == ' ') + start++; + + if (*start == '\'') + { + start++; + end = strchr(start, '\''); + while ((end) && (end > start) && (end[-1] == '\\')) + end = strchr(end + 1, '\''); + } + else + { + end = strchr(start, ' '); + while ((end) && (end > start) && (end[-1] == '\\')) + end = strchr(end + 1, ' '); + } + + /* Null terminate before the spaces */ + if (end) len = end - start; + else len = strlen(start); + + tmp = malloc(len + 1); + strncpy(tmp, start, len); + tmp[len] = '\0'; + + return tmp; +} + static void _atspi_expose_anchors(Eo *obj, Eina_Bool is_screen_reader) { @@ -8222,7 +8263,7 @@ _atspi_expose_anchors(Eo *obj, Eina_Bool is_screen_reader) p = strstr(s, "href="); if (p) { - name = strdup(p + 5); + name = _anchor_format_parse(p); } start = evas_object_textblock_cursor_new(tb);