Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_node_selected_delete ( Inkscape::NodePath::Path nodepath  ) 

Delete one or more selected nodes.

Todo:
fixme: do it the right way

Definition at line 2223 of file nodepath.cpp.

References Inkscape::NodePath::Path::desktop, Inkscape::NodePath::Path::selected, sp_nodepath_cleanup(), sp_nodepath_get_node_count(), sp_nodepath_node_destroy(), sp_nodepath_update_handles(), sp_nodepath_update_repr(), sp_nodepath_update_statusbar(), and Inkscape::NodePath::Path::subpaths.

{
    if (!nodepath) return;
    if (!nodepath->selected) return;

    /** \todo fixme: do it the right way */
    while (nodepath->selected) {
       Inkscape::NodePath::Node *node = (Inkscape::NodePath::Node *) nodepath->selected->data;
        sp_nodepath_node_destroy(node);
    }


    //clean up the nodepath (such as for trivial subpaths)
    sp_nodepath_cleanup(nodepath);

    sp_nodepath_update_handles(nodepath);

    // if the entire nodepath is removed, delete the selected object.
    if (nodepath->subpaths == NULL ||
        sp_nodepath_get_node_count(nodepath) < 2) {
        SPDocument *document = sp_desktop_document (nodepath->desktop);
        sp_selection_delete();
        sp_document_done (document, SP_VERB_CONTEXT_NODE,
                          _("Delete nodes"));
        return;
    }

    sp_nodepath_update_repr(nodepath, _("Delete nodes"));

    sp_nodepath_update_statusbar(nodepath);
}


Generated by  Doxygen 1.6.0   Back to index