Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_text.c Log Message: - Delay the creation of the trigger list until we needed. Should save some memory in the normal case. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_text.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -3 -r1.58 -r1.59 --- ewl_text.c 21 Nov 2005 18:04:22 -0000 1.58 +++ ewl_text.c 21 Nov 2005 18:13:46 -0000 1.59 @@ -103,8 +103,6 @@ ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_NONE); - t->triggers = ecore_list_new(); - /* create the formatting tree before we do any formatting */ t->formatting = ewl_text_tree_new(); if (!t->formatting) @@ -2038,6 +2036,9 @@ DCHECK_PARAM_PTR("t", t); DCHECK_TYPE("t", t, "text"); + if (!t->triggers) + DRETURN(DLEVEL_STABLE); + ecore_list_goto_first(t->triggers); while ((cur = ecore_list_next(t->triggers))) { @@ -2133,8 +2134,12 @@ ecore_list_destroy(t->areas); if (t->text_parent) { - if (ecore_list_goto(t->text_parent->triggers, t)) - ecore_list_remove(t->text_parent->triggers); + + if (t->text_parent->triggers) + { + if (ecore_list_goto(t->text_parent->triggers, t)) + ecore_list_remove(t->text_parent->triggers); + } } t->text_parent = NULL; @@ -2545,6 +2550,10 @@ DCHECK_TYPE("t", t, "text"); DCHECK_TYPE("trigger", trigger, "trigger"); + /* create the trigger list if needed */ + if (!t->triggers) + t->triggers = ecore_list_new(); + /* if we have no length, we start past the end of the text, or we * extend past the end of the text then return an error */ if ((trigger->len == 0) || (trigger->pos > t->length) @@ -2607,6 +2616,10 @@ DCHECK_TYPE("t", t, "text"); DCHECK_TYPE("trigger", trigger, "trigger"); + /* nothign to do if we have no triggers */ + if (!t->triggers) + DRETURN(DLEVEL_STABLE); + ecore_list_goto(t->triggers, trigger); ecore_list_remove(t->triggers); ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs