Code

Correct handling of version and set to 1.1 for default. Fixes bug #168180.
authorjoncruz <joncruz@users.sourceforge.net>
Tue, 9 Jun 2009 07:58:31 +0000 (07:58 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Tue, 9 Jun 2009 07:58:31 +0000 (07:58 +0000)
src/sp-root.cpp
src/version.h

index 4b584e97b23409d2dbbc0466e5b239b9bd4bb0ac..26845356f008e68ac186cd39780022bf5532d227 100644 (file)
@@ -150,6 +150,11 @@ sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
         root->original.sodipodi.major = 0;
         root->original.sodipodi.minor = 1;
     }
+
+    if ( !object->repr->attribute("version") ) {
+         repr->setAttribute("version", SVG_VERSION);
+     }
+
     sp_object_read_attr(object, "version");
     sp_object_read_attr(object, "sodipodi:version");
     sp_object_read_attr(object, "inkscape:version");
@@ -592,7 +597,9 @@ sp_root_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML:
         repr->setAttribute("inkscape:version", Inkscape::version_string);
     }
 
-    repr->setAttribute("version", SVG_VERSION);
+    if ( !repr->attribute("version") ) {
+        repr->setAttribute("version", sp_version_to_string(root->version.svg));
+    }
 
     if (fabs(root->x.computed) > 1e-9)
         sp_repr_set_svg_double(repr, "x", root->x.computed);
index 750ef8e552bdf82b61df625a8a6570561b139c77..98b6139144592a02ecacde8a5f5c90804deff9cd 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <glib/gtypes.h>
 
-#define SVG_VERSION "1.0"
+#define SVG_VERSION "1.1"
 #define SODIPODI_VERSION "0.32"
 
 namespace Inkscape {