aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2015-06-09 17:09:47 +0900
committerThiep Ha <thiepha@gmail.com>2015-06-09 18:17:17 +0900
commitb304f0bb21e14999ec804499d1f3dc73948b5b63 (patch)
tree8fe36f0ed7c90854b428318d270929761e636d2c
parentCnp/X11: correct object parameter in datacb (diff)
downloadelementary-devs/thiep/cnp.tar.gz
entry: add dnd image handlingdevs/thiep/cnp
When image is dropped into entry, we should insert image to it. This patch adds image inserting in dropping. @fix
-rw-r--r--src/lib/elm_entry.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 9ccb07596..1e6a97f1a 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -683,7 +683,6 @@ _drag_drop_cb(void *data EINA_UNUSED,
Elm_Selection_Data *drop)
{
Eina_Bool rv;
- char *buf;
ELM_ENTRY_DATA_GET(obj, sd);
@@ -694,20 +693,12 @@ _drag_drop_cb(void *data EINA_UNUSED,
if (!rv) WRN("Warning: Failed to position cursor: paste anyway");
- buf = malloc(drop->len + 1);
- if (!buf)
- {
- ERR("Failed to allocate memory for dropped text %p", obj);
- return EINA_FALSE;
- }
- memcpy(buf, drop->data, drop->len);
- buf[drop->len] = '\0';
- elm_entry_entry_insert(obj, buf);
- free(buf);
+ rv = _selection_data_cb(NULL, obj, drop);
+
edje_object_part_text_cursor_copy
(sd->entry_edje, "elm.text", EDJE_CURSOR_USER, /*->*/ EDJE_CURSOR_MAIN);
- return EINA_TRUE;
+ return rv;
}
static Elm_Sel_Format