summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-11-29 05:30:26 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-11-29 05:30:26 +0000
commitdcaba40d96d772aeca8b9ce9cee0abd86760c0f6 (patch)
tree02876f16769c12fa12bd3d7b8867a1c595fe24aa /src
parentUpdate strings pt_BR.po (diff)
downloadinkscape-dcaba40d96d772aeca8b9ce9cee0abd86760c0f6.tar.gz
inkscape-dcaba40d96d772aeca8b9ce9cee0abd86760c0f6.zip
allow sp_style_set_property_url to unset the property as well, if the linked object is NULL
(bzr r6917)
Diffstat (limited to 'src')
-rw-r--r--src/style.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/style.cpp b/src/style.cpp
index a5b25e6ff..4fd8577b9 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -3849,13 +3849,15 @@ sp_style_set_property_url (SPObject *item, gchar const *property, SPObject *link
if (repr == NULL) return;
- g_return_if_fail(linked != NULL);
-
- gchar *val = g_strdup_printf("url(#%s)", SP_OBJECT_ID(linked));
-
SPCSSAttr *css = sp_repr_css_attr_new();
- sp_repr_css_set_property(css, property, val);
- g_free(val);
+ if (linked) {
+ gchar *val = g_strdup_printf("url(#%s)", SP_OBJECT_ID(linked));
+ sp_repr_css_set_property(css, property, val);
+ g_free(val);
+ } else {
+ sp_repr_css_unset_property(css, "filter");
+ }
+
if (recursive) {
sp_repr_css_change_recursive(repr, css, "style");
} else {