]> git.sur5r.net Git - glabels/commitdiff
Applied barcode patch to save and restore barcode sizes, provided by Alessandro Zummo...
authorJim Evins <evins@snaught.com>
Sun, 27 Apr 2003 04:53:36 +0000 (04:53 +0000)
committerJim Evins <evins@snaught.com>
Sun, 27 Apr 2003 04:53:36 +0000 (04:53 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@253 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/xml-label.c

index c1445d79d26ea3244ddca2a6b8f33b9ff50d79a8..37f7f71efb3dd5d9be8e85d5ece01dde5929ad41 100644 (file)
@@ -660,6 +660,7 @@ xml_parse_barcode_props (xmlNodePtr  node,
 {
        GObject            *object;
        xmlNodePtr          child;
+       gdouble             w, h;
        gchar              *string;
        glTextNode         *text_node;
        glBarcodeStyle      style;
@@ -671,6 +672,9 @@ xml_parse_barcode_props (xmlNodePtr  node,
 
        object = gl_label_barcode_new (label);
 
+       w = gl_xml_get_prop_double (node, "w", 0);
+       h = gl_xml_get_prop_double (node, "h", 0);
+
        color = gl_xml_get_prop_uint_hex (node, "color", 0);
 
        string = xmlGetProp (node, "style");
@@ -693,6 +697,8 @@ xml_parse_barcode_props (xmlNodePtr  node,
                }
        }
 
+       gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
+
        gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node);
        gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
                                    style, text_flag, checksum_flag, color);
@@ -1180,6 +1186,7 @@ xml_create_barcode_props (xmlNodePtr     object_node,
                          xmlNsPtr       ns,
                          glLabelObject *object)
 {
+       gdouble     w, h;
        glTextNode          *text_node;
        glBarcodeStyle      style;
        gboolean            text_flag;
@@ -1191,6 +1198,12 @@ xml_create_barcode_props (xmlNodePtr     object_node,
 
        xmlSetProp (object_node, "type", "Barcode");
 
+       gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
+               
+       gl_xml_set_prop_double (object_node, "w", w);
+       gl_xml_set_prop_double (object_node, "h", h);
+                               
+
        text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object));
        gl_label_barcode_get_props (GL_LABEL_BARCODE(object),
                                    &style, &text_flag, &checksum_flag, &color);