summaryrefslogtreecommitdiffstats
path: root/src/preferences.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-09-20 11:19:44 +0000
committertavmjong-free <tavmjong@free.fr>2016-09-20 11:19:44 +0000
commit3e00389a40816c12b9b35e3061a752295387aad9 (patch)
tree8917a8e934ffee1420ba09af2bfa012797038dbb /src/preferences.cpp
parentAdd new function that removes properties with default values from SPCSSAttr. (diff)
downloadinkscape-3e00389a40816c12b9b35e3061a752295387aad9.tar.gz
inkscape-3e00389a40816c12b9b35e3061a752295387aad9.zip
Remove properties with default values from 'style' entries in users preferences.xml file.
This prevents 'style' entries from becoming full of unnecessary properties. (bzr r15123)
Diffstat (limited to 'src/preferences.cpp')
-rw-r--r--src/preferences.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/preferences.cpp b/src/preferences.cpp
index 988604a14..4d522a1d8 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -24,6 +24,7 @@
#include "xml/node-iterators.h"
#include "xml/attribute-record.h"
#include "util/units.h"
+#include "attribute-rel-util.h"
#define PREFERENCES_FILE_NAME "preferences.xml"
@@ -495,6 +496,7 @@ void Preferences::mergeStyle(Glib::ustring const &pref_path, SPCSSAttr *style)
{
SPCSSAttr *current = getStyle(pref_path);
sp_repr_css_merge(current, style);
+ sp_attribute_purge_default_style(current, SP_ATTR_CLEAN_DEFAULT_REMOVE);
Glib::ustring css_str;
sp_repr_css_write_string(current, css_str);
_setRawValue(pref_path, css_str);