edje_cc correctly copies group.limits when inheriting, FIXME--
authorMike Blumenkrantz <zmike@samsung.com>
Mon, 24 Mar 2014 19:26:49 +0000 (15:26 -0400)
committerMike Blumenkrantz <zmike@samsung.com>
Mon, 24 Mar 2014 19:27:17 +0000 (15:27 -0400)
src/bin/edje/edje_cc_handlers.c

index 39f260581425140917d47fbe89a355e831b49c57..26f4322f2d133f4c7acb0b21afcc36f1b526b69c 100644 (file)
@@ -2860,7 +2860,63 @@ st_collections_group_inherit(void)
    pcp2 = (Edje_Part_Collection_Parser *)pc2;
    pcp->default_mouse_events = pcp2->default_mouse_events;
 
-   // FIXME: Handle limits dup
+   {
+      Edje_Limit **elp;
+
+      elp = realloc(pc->limits.vertical,
+                    pc->limits.vertical_count + pc2->limits.vertical_count * sizeof(Edje_Limit *));
+      if (!elp)
+        {
+           ERR("Not enough memory.");
+           exit(-1);
+        }
+      pc->limits.vertical = elp;
+      offset = pc->limits.vertical_count;
+      for (i = 0; i < pc2->limits.vertical_count; i++)
+        {
+           Edje_Limit *el;
+
+           el = mem_alloc(SZ(Edje_Limit));
+           if (!el)
+             {
+                ERR("Not enough memory.");
+                exit(-1);
+             }
+
+           pc->limits.vertical[i + offset] = el;
+
+           el->name = STRDUP(pc2->limits.vertical[i]->name);
+           el->value = pc2->limits.vertical[i]->value;
+           pc->limits.vertical_count++;
+        }
+
+      elp = realloc(pc->limits.horizontal,
+                    pc->limits.horizontal_count + pc2->limits.horizontal_count * sizeof(Edje_Limit *));
+      if (!elp)
+        {
+           ERR("Not enough memory.");
+           exit(-1);
+        }
+      pc->limits.horizontal = elp;
+      offset = pc->limits.horizontal_count;
+      for (i = 0; i < pc2->limits.horizontal_count; i++)
+        {
+           Edje_Limit *el;
+
+           el = mem_alloc(SZ(Edje_Limit));
+           if (!el)
+             {
+                ERR("Not enough memory.");
+                exit(-1);
+             }
+
+           pc->limits.horizontal[i + offset] = el;
+
+           el->name = STRDUP(pc2->limits.horizontal[i]->name);
+           el->value = pc2->limits.horizontal[i]->value;
+           pc->limits.horizontal_count++;
+        }
+   }
 
    offset = pc->parts_count;
    for (i = 0 ; i < pc2->parts_count ; i++)