Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_text.c 


Log Message:
Fixup some of the entry behavior I broke yesterday.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- ewl_text.c  19 Jul 2004 18:16:25 -0000      1.70
+++ ewl_text.c  20 Jul 2004 17:53:11 -0000      1.71
@@ -121,7 +121,15 @@
        if (REALIZED(ta))
                ewl_text_ops_apply(ta);
 
-       text = (text ? strdup(text) : NULL);
+       IF_FREE(ta->text);
+       if (text) {
+               ta->text = strdup(text);
+               text = strdup(text);
+               ta->length = strlen(text);
+       }
+       else
+               ta->length = 0;
+
        ewl_callback_call_with_event_data(EWL_WIDGET(ta),
                                          EWL_CALLBACK_VALUE_CHANGED, text);
        IF_FREE(text);
@@ -139,12 +147,25 @@
  */
 void ewl_text_text_append(Ewl_Text * ta, char *text)
 {
+       int len = 0;
        Ewl_Text_Op *op;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("ta", ta);
        DCHECK_PARAM_PTR("text", text);
 
+       if (ta->text) {
+               len = strlen(ta->text) + strlen(text);
+               ta->text = realloc(ta->text, sizeof(char) * (len + 1));
+               strcat(ta->text, text);
+       }
+       else {
+               ta->text = strdup(text);
+               len = strlen(text);
+       }
+
+       ta->length = len;
+
        op = ewl_text_op_text_append_new(ta, text);
        ecore_dlist_append(ta->ops, op);
        if (REALIZED(ta))




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to