]> granicus.if.org Git - graphviz/commitdiff
Fixed initialization of attributes from ProtoGraph.
authornorth <devnull@localhost>
Thu, 25 Sep 2008 20:40:18 +0000 (20:40 +0000)
committernorth <devnull@localhost>
Thu, 25 Sep 2008 20:40:18 +0000 (20:40 +0000)
lib/cgraph/attr.c
lib/cgraph/edge.c

index 766f7eae02b6a410a9784a54d176a8c52d4a7b17..4045f812461d560c1a4385c213ff0568f6b7aed7 100644 (file)
@@ -90,6 +90,20 @@ static Agdatadict_t *agmakedatadict(Agraph_t * g)
        dtview(dd->dict.e, parent_dd->dict.e);
        dtview(dd->dict.g, parent_dd->dict.g);
     }
+    else {
+       if (ProtoGraph && (g != ProtoGraph)) {
+               /* you can't dtview here for several reasons. the proto
+               graph could change, and it changes the base index for g*/
+           Agsym_t *sym;       /* this could be written more functionally */
+           sym = 0;            /* but it's easy to read this way */
+           while ((sym = agnxtattr(ProtoGraph,AGRAPH,sym)))
+               agattr(g,AGRAPH,sym->name,sym->defval);
+           while ((sym = agnxtattr(ProtoGraph,AGNODE,sym)))
+               agattr(g,AGNODE,sym->name,sym->defval);
+           while ((sym = agnxtattr(ProtoGraph,AGEDGE,sym)))
+               agattr(g,AGEDGE,sym->name,sym->defval);
+       }
+    }
     return dd;
 }
 
index 9e199079ae5e801d6dee4bc5ad98ae1c30fed956..756f25eacf9633d77511713056744aaa3b291447 100644 (file)
@@ -313,9 +313,9 @@ void agdeledgeimage(Agraph_t * g, Agedge_t * e, void *ignored)
        del(g->e_id, &sn->in_id, in);
     }
 #ifdef DEBUG
-    for (e = agfstin(h); e; e = agnxtin(e))
+    for (e = agfstin(g,h); e; e = agnxtin(g,e))
        assert(e != in);
-    for (e = agfstout(t); e; e = agnxtout(e))
+    for (e = agfstout(g,t); e; e = agnxtout(g,e))
        assert(e != out);
 #endif
 }