Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_calc.c 


Log Message:
simplified _edje_part_description_apply(). one code block was executed twice for no 
reason apparently. removed some condition checks that aren't needed.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_calc.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- edje_calc.c 30 Oct 2004 13:02:28 -0000      1.50
+++ edje_calc.c 30 Oct 2004 14:19:46 -0000      1.51
@@ -95,45 +95,25 @@
 
    ep->param1.description = _edje_part_description_find(ed, ep, d1, v1);
    if (!ep->param1.description)
-     ep->param1.description = ep->part->default_desc;
+     ep->param1.description = ep->part->default_desc; /* never NULL */
 
    ep->param2.description = _edje_part_description_find(ed, ep, d2, v2);
 
-   ep->param1.rel1_to_x = NULL;
-   ep->param1.rel1_to_y = NULL;
-   ep->param1.rel2_to_x = NULL;
-   ep->param1.rel2_to_y = NULL;
-   if (ep->param1.description)
-     {
-       if (ep->param1.description->rel1.id_x >= 0)
-         ep->param1.rel1_to_x = ed->table_parts[ep->param1.description->rel1.id_x % 
ed->table_parts_size];
-       if (ep->param1.description->rel1.id_y >= 0)
-         ep->param1.rel1_to_y = ed->table_parts[ep->param1.description->rel1.id_y % 
ed->table_parts_size];
-       if (ep->param1.description->rel2.id_x >= 0)
-         ep->param1.rel2_to_x = ed->table_parts[ep->param1.description->rel2.id_x % 
ed->table_parts_size];
-       if (ep->param1.description->rel2.id_y >= 0)
-         ep->param1.rel2_to_y = ed->table_parts[ep->param1.description->rel2.id_y % 
ed->table_parts_size];
-     }
-   
-   ep->param1.rel1_to_x = NULL;
-   ep->param1.rel1_to_y = NULL;
-   ep->param1.rel2_to_x = NULL;
-   ep->param1.rel2_to_y = NULL;
-   if (ep->param1.description)
-     {
-       if (ep->param1.description->rel1.id_x >= 0)
-         ep->param1.rel1_to_x = ed->table_parts[ep->param1.description->rel1.id_x % 
ed->table_parts_size];
-       if (ep->param1.description->rel1.id_y >= 0)
-         ep->param1.rel1_to_y = ed->table_parts[ep->param1.description->rel1.id_y % 
ed->table_parts_size];
-       if (ep->param1.description->rel2.id_x >= 0)
-         ep->param1.rel2_to_x = ed->table_parts[ep->param1.description->rel2.id_x % 
ed->table_parts_size];
-       if (ep->param1.description->rel2.id_y >= 0)
-         ep->param1.rel2_to_y = ed->table_parts[ep->param1.description->rel2.id_y % 
ed->table_parts_size];
-     }
-   ep->param2.rel1_to_x = NULL;
-   ep->param2.rel1_to_y = NULL;
-   ep->param2.rel2_to_x = NULL;
-   ep->param2.rel2_to_y = NULL;
+   ep->param1.rel1_to_x = ep->param1.rel1_to_y = NULL;
+   ep->param1.rel2_to_x = ep->param1.rel2_to_y = NULL;
+
+   if (ep->param1.description->rel1.id_x >= 0)
+     ep->param1.rel1_to_x = ed->table_parts[ep->param1.description->rel1.id_x % 
ed->table_parts_size];
+   if (ep->param1.description->rel1.id_y >= 0)
+     ep->param1.rel1_to_y = ed->table_parts[ep->param1.description->rel1.id_y % 
ed->table_parts_size];
+   if (ep->param1.description->rel2.id_x >= 0)
+     ep->param1.rel2_to_x = ed->table_parts[ep->param1.description->rel2.id_x % 
ed->table_parts_size];
+   if (ep->param1.description->rel2.id_y >= 0)
+     ep->param1.rel2_to_y = ed->table_parts[ep->param1.description->rel2.id_y % 
ed->table_parts_size];
+
+   ep->param2.rel1_to_x = ep->param2.rel1_to_y = NULL;
+   ep->param2.rel2_to_x = ep->param2.rel2_to_y = NULL;
+
    if (ep->param2.description)
      {
        if (ep->param2.description->rel1.id_x >= 0)
@@ -145,12 +125,12 @@
        if (ep->param2.description->rel2.id_y >= 0)
          ep->param2.rel2_to_y = ed->table_parts[ep->param2.description->rel2.id_y % 
ed->table_parts_size];
      }
+
    if (ep->description_pos == 0.0)
      ep->chosen_description = ep->param1.description;
    else
      ep->chosen_description = ep->param2.description;
-   if (!ep->chosen_description)
-     ep->chosen_description = ep->param2.description;
+
    ed->dirty = 1;
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to