[gegl] gegl-xml: Unbreak serialization of empty graphs



commit 09993e3bf24a42c20c4f67285514adbbd53bef27
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Jan 16 16:20:32 2016 +0100

    gegl-xml: Unbreak serialization of empty graphs
    
    Nodes without any children at all (or empty graphs) have is_graph set
    to FALSE. Therefore, the condition to handle non-meta-op graphs was
    excluding such nodes. Trying to serialize such a node would lead to:
      CRITICAL **: gegl_node_get: assertion 'self->is_graph ||
        GEGL_IS_OPERATION (self->operation)' failed
    
    Checking for the absence of a GeglOperation object covers both cases.
    This is unlike gegl_node_get_operation which returns NULL for one and
    "GraphNode" for another.
    
    As a nice side-effect, this reverts to using only public API in
    gegl_xml functions.
    
    Fall out from 6a791c1f74c90c6d34e57edc32d026f3a4d244b8
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760161

 gegl/gegl-xml.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gegl/gegl-xml.c b/gegl/gegl-xml.c
index ba037ae..30dc549 100644
--- a/gegl/gegl-xml.c
+++ b/gegl/gegl-xml.c
@@ -27,7 +27,6 @@
 #include "gegl.h"
 #include "property-types/gegl-paramspecs.h"
 #include "gegl-instrument.h"
-#include "gegl-node-private.h"
 #include "gegl-xml.h"
 
 #ifdef G_OS_WIN32
@@ -1159,8 +1158,10 @@ gegl_node_to_xml (GeglNode    *gegl,
   ss.terse       = FALSE;
 
   operation = gegl_node_get_gegl_operation (gegl);
-  /* this case is probably only for empty graphs */
-  if (gegl->is_graph && !operation)
+  /* this case is for empty graphs, and graphs with nodes that are
+   * not meta-ops
+   */
+  if (!operation)
     gegl = gegl_node_get_output_proxy (gegl, "output");
 
   g_string_append (ss.buf, "<?xml version='1.0' encoding='UTF-8'?>\n");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]