summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-08-05 15:54:12 +0000
committerTavmjong Bah <tavmjong@free.fr>2017-08-05 15:54:12 +0000
commit47865cbb214252f72f9b89a0422fab263b4f1263 (patch)
tree04a84df643e42fa98062cc485979f40ccad8bfa5 /src/xml
parentMerge branch 'feature_hslInDegrees' of gitlab.com:RomanHargrave/inkscape (diff)
downloadinkscape-47865cbb214252f72f9b89a0422fab263b4f1263.tar.gz
inkscape-47865cbb214252f72f9b89a0422fab263b4f1263.zip
Add GUI and code to implement "Line Spacing Modes".
Selecting a Line Spacing Mode allows a user to quickly pick an algorithm for consistant line spacing.
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/repr-css.cpp11
-rw-r--r--src/xml/repr.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp
index 9590fa97f..2970c1da5 100644
--- a/src/xml/repr-css.cpp
+++ b/src/xml/repr-css.cpp
@@ -466,6 +466,17 @@ void sp_repr_css_change_recursive(Node *repr, SPCSSAttr *css, gchar const *attr)
}
}
+/**
+ * Return a new SPCSSAttr with all the properties found in the input SPCSSAttr unset.
+ */
+SPCSSAttr* sp_repr_css_attr_unset_all(SPCSSAttr *css)
+{
+ SPCSSAttr* css_unset = sp_repr_css_attr_new();
+ for ( List<AttributeRecord const> iter = css->attributeList() ; iter ; ++iter ) {
+ sp_repr_css_set_property (css_unset, g_quark_to_string(iter->key), "inkscape:unset");
+ }
+ return css_unset;
+}
/*
Local Variables:
diff --git a/src/xml/repr.h b/src/xml/repr.h
index e84b89813..ecc5c02a6 100644
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
@@ -80,6 +80,7 @@ void sp_repr_css_attr_unref(SPCSSAttr *css);
SPCSSAttr *sp_repr_css_attr(Inkscape::XML::Node *repr, char const *attr);
SPCSSAttr *sp_repr_css_attr_parse_color_to_fill(const Glib::ustring &text);
SPCSSAttr *sp_repr_css_attr_inherited(Inkscape::XML::Node *repr, char const *attr);
+SPCSSAttr *sp_repr_css_attr_unset_all(SPCSSAttr *css);
char const *sp_repr_css_property(SPCSSAttr *css, char const *name, char const *defval);
void sp_repr_css_set_property(SPCSSAttr *css, char const *name, char const *value);
@@ -93,7 +94,6 @@ void sp_repr_css_merge(SPCSSAttr *dst, SPCSSAttr *src);
void sp_repr_css_attr_add_from_string(SPCSSAttr *css, const char *data);
void sp_repr_css_change(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key);
void sp_repr_css_change_recursive(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key);
-
void sp_repr_css_print(SPCSSAttr *css);
/* Utility finctions */