summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-06-12 08:25:42 +0000
committertavmjong-free <tavmjong@free.fr>2016-06-12 08:25:42 +0000
commit6ed2673499ca548767bb7d2edb453a228ece86fd (patch)
treed1a4293bbd40102f2c5aeea26991f05c786ed256 /src/xml
parentExtensions: Use underscored variants of parameters / attribute names in inter... (diff)
downloadinkscape-6ed2673499ca548767bb7d2edb453a228ece86fd.tar.gz
inkscape-6ed2673499ca548767bb7d2edb453a228ece86fd.zip
Optionally sort attributes and properties into a canonical order.
Useful for comparing different versions of an SVG file. (bzr r14980)
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/repr-io.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index 4a6f59b43..6977bc1e2 100644
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
@@ -34,6 +34,7 @@
#include "extension/extension.h"
#include "attribute-rel-util.h"
+#include "attribute-sort-util.h"
#include "preferences.h"
@@ -882,6 +883,10 @@ static void sp_repr_write_stream_root_element(Node *repr, Writer &out,
bool clean = prefs->getBool("/options/svgoutput/check_on_writing");
if (clean) sp_attribute_clean_tree( repr );
+ // Sort attributes in a canonical order (helps with "diffing" SVG files).
+ bool sort = prefs->getBool("/options/svgoutput/sort_attributes");
+ if (sort) sp_attribute_sort_tree( repr );
+
Glib::QueryQuark xml_prefix=g_quark_from_static_string("xml");
NSMap ns_map;