]> granicus.if.org Git - graphviz/commitdiff
set job->flags earlier - i.e. before using
authorellson <devnull@localhost>
Thu, 11 Oct 2007 19:56:48 +0000 (19:56 +0000)
committerellson <devnull@localhost>
Thu, 11 Oct 2007 19:56:48 +0000 (19:56 +0000)
lib/common/emit.c
lib/gvc/gvrender.c

index 600f200765f6781425797a3d3c4d27943c090991..aba905eba00bab7561f477ad6fbbf6e54c12fdcd 100644 (file)
@@ -536,29 +536,6 @@ static int chkOrder(graph_t * g)
     return 0;
 }
 
-static void init_job_flags(GVJ_t * job, graph_t * g)
-{
-    switch (job->output_lang) {
-    case GVRENDER_PLUGIN:
-       job->flags |= chkOrder(g)
-                  | job->render.features->flags
-                  | job->device.features->flags;
-       break;
-    case VTX:
-        /* output sorted, i.e. all nodes then all edges */
-        job->flags |= EMIT_SORTED;
-        break;
-    case DIA:
-        /* output in preorder traversal of the graph */
-        job->flags |= EMIT_PREORDER
-                  | GVDEVICE_BINARY_FORMAT;
-        break;
-    default:
-        job->flags |= chkOrder(g);
-        break;
-    }
-}
-
 static void init_layering(GVC_t * gvc, graph_t * g)
 {
     char *str;
@@ -2730,7 +2707,20 @@ int gvRenderJobs (GVC_t * gvc, graph_t * g)
        Output_lang = job->output_lang;
 #endif
 
-       init_job_flags(job, g);
+        switch (job->output_lang) {
+        case VTX:
+            /* output sorted, i.e. all nodes then all edges */
+            job->flags |= EMIT_SORTED;
+            break;
+        case DIA:
+            /* output in preorder traversal of the graph */
+            job->flags |= EMIT_PREORDER
+                      | GVDEVICE_BINARY_FORMAT;
+            break;
+        default:
+            job->flags |= chkOrder(g);
+            break;
+        }
 
        /* if we already have an active job list and the device doesn't support mutiple output files, or we are about to write to a different output device */
         firstjob = gvc->active_jobs;
index d7aa0f454909369e40a052112dec7691febda6b9..a219af027725e68c3313e73f028507b4fedff861 100644 (file)
@@ -59,6 +59,7 @@ int gvrender_select(GVJ_t * job, char *str)
 
     gvplugin_load(gvc, API_device, str);
 
+    job->flags = 0;
     plugin = gvc->api[API_device];
     if (plugin) {
 #ifdef WITH_CODEGENS
@@ -74,6 +75,8 @@ int gvrender_select(GVJ_t * job, char *str)
         job->device.features = (gvdevice_features_t *) (typeptr->features);
         job->device.id = typeptr->id;
         job->device.type = plugin->typestr;
+
+        job->flags |= job->device.features->flags;
     }
     else
        return NO_SUPPORT;  /* FIXME - should differentiate problem */
@@ -87,6 +90,8 @@ int gvrender_select(GVJ_t * job, char *str)
         job->render.features = (gvrender_features_t *) (typeptr->features);
         job->render.type = plugin->typestr;
 
+        job->flags |= job->render.features->flags;
+
         if (job->device.engine)
             job->render.id = typeptr->id;
        else