summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-10 13:20:56 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-10 13:23:05 -0400
commitec3cb831858ca95e247492f245cc755a26ca8eb2 (patch)
tree09645c4681e705d2e32eca2ae79eeb89a01f8b7f
parent37ed59474eaea466663d1da218b447f8427263f9 (diff)
Revert "elm entry: remove unused funtions"
This reverts commit 2e68debe7b6853dff2d58e1fa89ba7939708871f. ref T3455
-rw-r--r--src/lib/elementary/elm_entry.c74
-rw-r--r--src/lib/elementary/elm_priv.h3
2 files changed, 77 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index f26e80369f..008a6e63d9 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -1398,6 +1398,80 @@ _hover_selected_cb(void *data,
1398 elm_widget_scroll_hold_push(data); 1398 elm_widget_scroll_hold_push(data);
1399} 1399}
1400 1400
1401static char *
1402_item_tags_remove(const char *str)
1403{
1404 char *ret;
1405 Eina_Strbuf *buf;
1406
1407 if (!str)
1408 return NULL;
1409
1410 buf = eina_strbuf_new();
1411 if (!buf)
1412 return NULL;
1413
1414 if (!eina_strbuf_append(buf, str))
1415 {
1416 eina_strbuf_free(buf);
1417 return NULL;
1418 }
1419
1420 while (EINA_TRUE)
1421 {
1422 const char *temp = eina_strbuf_string_get(buf);
1423 char *start_tag = NULL;
1424 char *end_tag = NULL;
1425 size_t sindex;
1426 size_t eindex;
1427
1428 start_tag = strstr(temp, "<item");
1429 if (!start_tag)
1430 start_tag = strstr(temp, "</item");
1431 if (start_tag)
1432 end_tag = strstr(start_tag, ">");
1433 else
1434 break;
1435 if (!end_tag || start_tag > end_tag)
1436 break;
1437
1438 sindex = start_tag - temp;
1439 eindex = end_tag - temp + 1;
1440 if (!eina_strbuf_remove(buf, sindex, eindex))
1441 break;
1442 }
1443
1444 ret = eina_strbuf_string_steal(buf);
1445 eina_strbuf_free(buf);
1446
1447 return ret;
1448}
1449
1450void
1451_elm_entry_entry_paste(Evas_Object *obj,
1452 const char *entry)
1453{
1454 char *str = NULL;
1455
1456 if (!entry) return;
1457
1458 ELM_ENTRY_CHECK(obj);
1459 ELM_ENTRY_DATA_GET(obj, sd);
1460
1461 if (sd->cnp_mode == ELM_CNP_MODE_NO_IMAGE)
1462 {
1463 str = _item_tags_remove(entry);
1464 if (!str) str = strdup(entry);
1465 }
1466 else
1467 str = strdup(entry);
1468 if (!str) str = (char *)entry;
1469
1470 _edje_entry_user_insert(obj, str);
1471
1472 if (str != entry) free(str);
1473}
1474
1401static void 1475static void
1402_paste_cb(void *data, 1476_paste_cb(void *data,
1403 Evas_Object *obj EINA_UNUSED, 1477 Evas_Object *obj EINA_UNUSED,
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 90789bb7d9..21c510f3cc 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -600,6 +600,9 @@ _elm_dgettext(const char *string)
600 600
601#endif 601#endif
602 602
603/* Used by the paste handler */
604void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);
605
603double _elm_atof(const char *s); 606double _elm_atof(const char *s);
604 607
605#endif 608#endif