Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void sp_gradient_repr_clear_vector ( SPGradient gr )

Clears the gradient's svg:stop children from its repr.

Todo:
fixme: This should work, unless we make gradient into generic group.

Definition at line 932 of file sp-gradient.cpp.

References Inkscape::XML::Node::firstChild(), and sp_repr_unparent().

Referenced by sp_gradient_repr_write_vector().

{
    Inkscape::XML::Node *repr = SP_OBJECT_REPR(gr);

    /* Collect stops from original repr */
    GSList *sl = NULL;
    for (Inkscape::XML::Node *child = repr->firstChild() ; child != NULL; child = child->next() ) {
        if (!strcmp(child->name(), "svg:stop")) {
            sl = g_slist_prepend(sl, child);
        }
    }
    /* Remove all stops */
    while (sl) {
        /** \todo
         * fixme: This should work, unless we make gradient
         * into generic group.
         */
        sp_repr_unparent((Inkscape::XML::Node *)sl->data);
        sl = g_slist_remove(sl, sl->data);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index