]> granicus.if.org Git - graphviz/commitdiff
some cgraph fixes
authorellson <devnull@localhost>
Tue, 21 Oct 2008 16:28:45 +0000 (16:28 +0000)
committerellson <devnull@localhost>
Tue, 21 Oct 2008 16:28:45 +0000 (16:28 +0000)
lib/common/emit.c
lib/common/output.c

index e7464260536dc1fe037c14bd284794ff5e7fa50b..13a85343f849bd672efb06fca0f3faaf05b14063 100644 (file)
@@ -1031,7 +1031,7 @@ static boolean clust_in_layer(GVJ_t *job, graph_t * sg)
 #ifndef WITH_CGRAPH
     pg = late_string(sg, agfindattr(sg, "layer"), "");
 #else
-    pg = late_string(sg, agfindattr(sg, "layer"), "");
+    pg = late_string(sg, agattr(sg, AGRAPH, "layer", 0), "");
 #endif
     if (selectedlayer(job, pg))
        return TRUE;
@@ -2346,7 +2346,11 @@ fprintf(stderr,"focus=%g,%g view=%g,%g\n",
        job->focus.x, job->focus.y, job->view.x, job->view.y);
 #endif
 
+#ifndef WITH_CGRAPH
     s = late_string(g, agfindattr(g, "comment"), "");
+#else
+    s = late_string(g, agattr(g, AGRAPH, "comment", 0), "");
+#endif
     gvrender_comment(job, s);
 
     emit_begin_graph(job, g);
index 83d449210cfede0588032a25354cecb1b2e7e7f7..a576de9d03659d8045f020195f8480376c04cce8 100644 (file)
@@ -122,20 +122,22 @@ void write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend)
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
 
+#ifndef WITH_CGRAPH
 /* FIXME - there must be a proper way to get port info - these are 
  * supposed to be private to libgraph - from libgraph.h */
 #define TAILX 1
 #define HEADX 2
 
-#ifndef WITH_CGRAPH
            if (extend && e->attr) {
                tport = e->attr[TAILX];
                hport = e->attr[HEADX];
            }
 #else /* WITH_CGRAPH */
            if (extend) {               //assuming these two attrs have already been created by cgraph
-               tport = agget(e,TAILX);
-               hport = agget(e,HEADX);
+               if (!(tport = agget(e,"tailport")))
+                   tport = "";
+               if (!(hport = agget(e,"headport")))
+                   hport = "";
            }
 #endif /* WITH_CGRAPH */
            else