summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2016-07-27 15:50:24 +0000
committerTed Gould <ted@gould.cx>2016-07-27 15:50:24 +0000
commite0564a4174331f32970bd28695fae5732420accc (patch)
treec6b4c430d785bd83f7a930ce4b2c17d6c5a68980 /src/xml
parentAdd build dependencies (diff)
parentRevert the canvas widget changes, which cause performance regressions (diff)
downloadinkscape-e0564a4174331f32970bd28695fae5732420accc.tar.gz
inkscape-e0564a4174331f32970bd28695fae5732420accc.zip
Merge 0.92.x branch
(bzr r14950.1.12)
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/event.h14
-rw-r--r--src/xml/repr-io.cpp5
2 files changed, 12 insertions, 7 deletions
diff --git a/src/xml/event.h b/src/xml/event.h
index 73e68daeb..f6b734c29 100644
--- a/src/xml/event.h
+++ b/src/xml/event.h
@@ -33,13 +33,13 @@ namespace XML {
/**
* @brief Enumeration of all XML event types
*/
-enum EventType {
- EVENT_ADD, ///< Child added
- EVENT_DEL, ///< Child removed
- EVENT_CHG_ATTR, ///< Attribute changed
- EVENT_CHG_CONTENT, ///< Content changed
- EVENT_CHG_ORDER ///< Order of children changed
-};
+// enum EventType {
+// EVENT_ADD, ///< Child added
+// EVENT_DEL, ///< Child removed
+// EVENT_CHG_ATTR, ///< Attribute changed
+// EVENT_CHG_CONTENT, ///< Content changed
+// EVENT_CHG_ORDER ///< Order of children changed
+// };
/**
* @brief Generic XML modification event
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;