jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=a17116e74a0106515c181eaa931f99fc6fccf0bb

commit a17116e74a0106515c181eaa931f99fc6fccf0bb
Author: Thiep Ha <thie...@gmail.com>
Date:   Tue Jun 9 17:09:47 2015 +0900

    entry: add dnd image handling
    
    When image is dropped into entry, we should insert image to it.
    This patch adds image inserting in dropping.
    
    @fix
---
 src/lib/elm_entry.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 0401604..3eb4c11 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -687,7 +687,6 @@ _drag_drop_cb(void *data EINA_UNUSED,
               Elm_Selection_Data *drop)
 {
    Eina_Bool rv;
-   char *buf;
 
    ELM_ENTRY_DATA_GET(obj, sd);
 
@@ -698,20 +697,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

-- 


Reply via email to