summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2015-06-09 17:09:47 +0900
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2015-06-12 11:53:57 +0300
commita17116e74a0106515c181eaa931f99fc6fccf0bb (patch)
treed70667fed59b5c713c3f8509582f00edef000b2f
parent855ef0dbd4cc7ca53580594df36b50131122bb02 (diff)
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
-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 040160442..3eb4c1121 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -687,7 +687,6 @@ _drag_drop_cb(void *data EINA_UNUSED,
687 Elm_Selection_Data *drop) 687 Elm_Selection_Data *drop)
688{ 688{
689 Eina_Bool rv; 689 Eina_Bool rv;
690 char *buf;
691 690
692 ELM_ENTRY_DATA_GET(obj, sd); 691 ELM_ENTRY_DATA_GET(obj, sd);
693 692
@@ -698,20 +697,12 @@ _drag_drop_cb(void *data EINA_UNUSED,
698 697
699 if (!rv) WRN("Warning: Failed to position cursor: paste anyway"); 698 if (!rv) WRN("Warning: Failed to position cursor: paste anyway");
700 699
701 buf = malloc(drop->len + 1); 700 rv = _selection_data_cb(NULL, obj, drop);
702 if (!buf) 701
703 {
704 ERR("Failed to allocate memory for dropped text %p", obj);
705 return EINA_FALSE;
706 }
707 memcpy(buf, drop->data, drop->len);
708 buf[drop->len] = '\0';
709 elm_entry_entry_insert(obj, buf);
710 free(buf);
711 edje_object_part_text_cursor_copy 702 edje_object_part_text_cursor_copy
712 (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, /*->*/ EDJE_CURSOR_MAIN); 703 (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, /*->*/ EDJE_CURSOR_MAIN);
713 704
714 return EINA_TRUE; 705 return rv;
715} 706}
716 707
717static Elm_Sel_Format 708static Elm_Sel_Format