Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_textarea.c ewl_textarea.h 


Log Message:
Save the string length ourselves.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_textarea.c      19 May 2004 05:43:13 -0000      1.28
+++ ewl_textarea.c      22 May 2004 06:20:02 -0000      1.29
@@ -101,13 +101,19 @@
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("ta", ta);
-       DCHECK_PARAM_PTR("text", text);
 
-       /*
-        * Keep a copy of the text for quick access and for creating the etox
-        * when needed.
-        */
-       ta->text = strdup(text);
+       if (text) {
+               /*
+                * Keep a copy of the text for quick access and for creating
+                * the etox when needed.
+                */
+               ta->text = strdup(text);
+               ta->length = strlen(text);
+       }
+       else {
+               ta->text = NULL;
+               ta->length = 0;
+       }
 
        /*
         * Update the etox and the sizing of the text widget.
@@ -147,17 +153,10 @@
  */
 int ewl_text_length_get(Ewl_Text *ta)
 {
-       int len = 0;
-
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET("ta", ta, 0);
 
-       if (ta->etox)
-               len = etox_get_length(ta->etox);
-       else if (ta->text)
-               len = strlen(ta->text);
-
-       DRETURN_INT(len, DLEVEL_STABLE);
+       DRETURN_INT(ta->length, DLEVEL_STABLE);
 }
 
 /**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_textarea.h      19 May 2004 05:43:13 -0000      1.12
+++ ewl_textarea.h      22 May 2004 06:20:02 -0000      1.13
@@ -35,6 +35,7 @@
 {
        Ewl_Widget      widget;       /**< Inherit from Ewl_Widget */
        char           *text;         /**< The initial text in the text */
+       int             length;       /**< Length of the text displayed */
        Evas_Object    *etox;         /**< Etox does the actual layout work */
        Etox_Context   *context; /**< Contains various format settings */
        Ecore_DList    *ops;          /**< Series of operations to apply */




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to