[dia] svg: comment on <use/> styling and a leak fix



commit 3e5634b9a3ac7d7c413511d599f9ee4ba4e22bcc
Author: Hans Breuer <hans breuer org>
Date:   Sat Sep 7 11:42:21 2013 +0200

    svg: comment on <use/> styling and a leak fix

 plug-ins/svg/svg-import.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/svg/svg-import.c b/plug-ins/svg/svg-import.c
index a38dee3..88e8fce 100644
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -65,8 +65,9 @@ get_colour(gint32 c, real opacity)
     return colour;
 }
 
-/* Dia default scale is 20px per cm; the user scale *should* be dynamic but this would involve a 
- *  much more complicated approach than implemented in this imported (transformations!)  
+/* Dia default scale is 20px per cm; the user scale *should* be dynamic but this would 
+ * involve a  much more complicated approach than implemented in this importer, e.g.
+ * full transformations and dynamic scale to view port (viewBox).
  */
 const gdouble DEFAULT_SVG_SCALE = 20.0;
 static gdouble user_scale = 20.0;
@@ -1435,12 +1436,16 @@ read_items (xmlNodePtr   startnode,
           *  - use the style from the group and hope it is on defaults
           *  - use a style from scratch instead of parent_gs and hope
           *    the object is already styled correctly
+          * Or maybe we should remember the explicit style set during
+          * creation, store it with the template as meta info and use
+          * that to give NULL or parent_gs here?
           */
          apply_style (obj, node, NULL, style_ht, FALSE);
          items = g_list_append (items, obj);
        }
-       xmlFree (key);
       }
+      if (key)
+       xmlFree (key);
     } else if(!xmlStrcmp(node->name, (const xmlChar *)"style")) {
       /* Prepare the third variant to apply style to the objects.
        * The final style is similar to what we have in the style


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