diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-10-07 19:43:42 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-10-07 19:43:42 +0000 |
| commit | 94d861cae0e80c71f2ec36331b943cbdecfd57db (patch) | |
| tree | e970c635980e049b43b12fb11cd4ac0248727a6f /src/style.cpp | |
| parent | Implement singleton behaviour for undo history dialog. Make sure event (diff) | |
| download | inkscape-94d861cae0e80c71f2ec36331b943cbdecfd57db.tar.gz inkscape-94d861cae0e80c71f2ec36331b943cbdecfd57db.zip | |
add generic set-property-to-this-object-url method
(bzr r1773)
Diffstat (limited to '')
| -rw-r--r-- | src/style.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/style.cpp b/src/style.cpp index bd880b857..048801ae4 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -3693,6 +3693,31 @@ sp_style_filter_clear(SPStyle *style, SPIFilter *f) } +// FIXME: Everything below this line belongs in a different file - css-chemistry? + +void +sp_style_set_property_url (SPObject *item, gchar const *property, SPObject *linked, bool recursive) +{ + Inkscape::XML::Node *repr = SP_OBJECT_REPR(item); + + 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 (recursive) { + sp_repr_css_change_recursive(repr, css, "style"); + } else { + sp_repr_css_change(repr, css, "style"); + } + sp_repr_css_attr_unref(css); +} + + /** * Clear all style property attributes in object. */ |
