From 67dd47d09ea3e30da176a174dadae16f475d1e43 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sat, 29 Nov 2008 05:30:26 +0000 Subject: [PATCH] allow sp_style_set_property_url to unset the property as well, if the linked object is NULL --- src/style.cpp | 14 ++++++++------ 1 file 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 { -- 2.30.2