]> granicus.if.org Git - graphviz/commitdiff
Fix bug in gvpack. The new library architecture requires a gvc attached to
authorerg <devnull@localhost>
Fri, 16 Mar 2007 15:10:14 +0000 (15:10 +0000)
committererg <devnull@localhost>
Fri, 16 Mar 2007 15:10:14 +0000 (15:10 +0000)
a graph in order to do font lookup.

cmd/tools/gvpack.c

index 21bce0f91f4f4be8a39c2d4154866bf8c22a1348..10234dcc4fc55341bd717551f6219d2a5f6f155b 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include <assert.h>
+#include <gvc.h>
 #include <render.h>
 #include <neatoprocs.h>
 #include <ingraphs.h>
@@ -668,7 +669,7 @@ static Agraph_t *cloneGraph(Agraph_t ** gs, int cnt)
  * combined graph will be strict; other, the combined graph will
  * be non-strict.
  */
-static Agraph_t **readGraphs(int *cp)
+static Agraph_t **readGraphs(int *cp, GVC_t* gvc)
 {
     Agraph_t *g;
     Agraph_t **gs = 0;
@@ -682,6 +683,7 @@ static Agraph_t **readGraphs(int *cp)
 
     newIngraph(&ig, myFiles, agread);
     while ((g = nextGraph(&ig)) != 0) {
+       GD_gvc(g) = gvc;
        if (verbose)
            fprintf(stderr, "Reading graph %s\n", g->name);
        if (cnt >= sz) {
@@ -766,10 +768,12 @@ int main(int argc, char *argv[])
     int cnt;
     pack_info pinfo;
     box bb;
+    GVC_t * gvc;
 
     init(argc, argv);
 
-    gs = readGraphs(&cnt);
+    gvc = gvNEWcontext(Info, gvUsername());
+    gs = readGraphs(&cnt, gvc);
     if (cnt == 0)
        exit(0);