[dia] vdx: remember shape ID in object meta info



commit 5d57e7d2d2c2a3ae4e673af3c36bb46550402a28
Author: Hans Breuer <hans breuer org>
Date:   Sat Jun 25 11:40:18 2011 +0200

    vdx: remember shape ID in object meta info
    
    At least it helps debugging, i.e. finding a malformed
    object in the original VDX got a lot easier.

 plug-ins/vdx/vdx-import.c |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/plug-ins/vdx/vdx-import.c b/plug-ins/vdx/vdx-import.c
index a152ad8..dfc16c7 100644
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -2676,11 +2676,17 @@ vdx_plot_shape(struct vdx_Shape *Shape, GSList *objects,
         more = Geom->any.children;
         do
         {
-            objects =
-                g_slist_append(objects,
-                               plot_geom(Geom, XForm, XForm1D, Fill, Line,
-                                         Foreign, ForeignData, theDoc, &more,
-                                         &current));
+	    DiaObject *object = plot_geom(Geom, XForm, XForm1D, Fill, Line,
+                                          Foreign, ForeignData, theDoc, &more,
+                                          &current);
+            /* object can be NULL for Text */
+	    if (object)
+	    {
+		gchar *id = g_strdup_printf ("%d", Shape->ID);
+		objects = g_slist_append(objects, object);
+		dia_object_set_meta (object, "id", id);
+		g_free (id);
+	    }
             if (more && theDoc->debug_comments)
             {
                 g_debug("Additional Geom");
@@ -2693,10 +2699,15 @@ vdx_plot_shape(struct vdx_Shape *Shape, GSList *objects,
        so it appears on top */
     if (Text && find_child(vdx_types_text, Text))
     {
-        objects =
-            g_slist_append(objects,
-                           plot_text(Text, XForm, Char, Para,
-                                     TextBlock, TextXForm, theDoc));
+        DiaObject *object = plot_text(Text, XForm, Char, Para,
+                                      TextBlock, TextXForm, theDoc);
+	if (object)
+	{
+	    gchar *id = g_strdup_printf ("%d", Shape->ID);
+            objects = g_slist_append(objects, object);
+	    dia_object_set_meta (object, "id", id);
+	    g_free (id);
+	}
     }
 
     /* Wipe the child XForm list to avoid double-free */



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