From dcaba40d96d772aeca8b9ce9cee0abd86760c0f6 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sat, 29 Nov 2008 05:30:26 +0000 Subject: allow sp_style_set_property_url to unset the property as well, if the linked object is NULL (bzr r6917) --- src/style.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/style.cpp') 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 { -- cgit v1.2.3