From 6ed2673499ca548767bb7d2edb453a228ece86fd Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sun, 12 Jun 2016 10:25:42 +0200 Subject: Optionally sort attributes and properties into a canonical order. Useful for comparing different versions of an SVG file. (bzr r14980) --- src/xml/repr-io.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/xml') 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; -- cgit v1.2.3