Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/etox
Dir : e17/libs/etox/src
Modified Files:
etox.c
Log Message:
Use the evas_list_last feature for finding the end of the line lists when
adding text. Added a test for etox_prepend_text.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- etox.c 26 Jul 2003 07:17:59 -0000 1.45
+++ etox.c 27 Jul 2003 05:27:09 -0000 1.46
@@ -189,7 +189,7 @@
*/
void etox_append_text(Etox * et, char *text)
{
- Evas_List *lines, *l;
+ Evas_List *lines;
Etox_Line *end = NULL, *start;
CHECK_PARAM_POINTER("et", et);
@@ -203,14 +203,15 @@
if (!lines)
return;
- for (l = et->lines; l; l = l->next)
- end = l->data;
-
/*
* Merge the last line of the existing text with the first line of the
* new text.
*/
if (et->lines) {
+ Evas_List *l;
+
+ l = evas_list_last(et->lines);
+ end = l->data;
start = lines->data;
lines = evas_list_remove(lines, start);
@@ -263,7 +264,7 @@
*/
void etox_prepend_text(Etox * et, char *text)
{
- Evas_List *lines, *l;
+ Evas_List *lines;
Etox_Line *end = NULL, *start;
CHECK_PARAM_POINTER("et", et);
@@ -277,14 +278,15 @@
if (!lines)
return;
- for (l = lines; l; l = l->next)
- end = l->data;
-
/*
* Merge the first line of the existing text with the last line of the
* new text.
*/
if (et->lines) {
+ Evas_List *l;
+
+ l = evas_list_last(lines);
+ end = l->data;
start = et->lines->data;
et->lines = evas_list_remove(et->lines, start);
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs