diff options
| author | bulia byak <buliabyak@gmail.com> | 2008-03-19 08:54:26 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2008-03-19 08:54:26 +0000 |
| commit | 6a9cf3b81e83a1ed4483e7dd51a3daae6e30647f (patch) | |
| tree | ef3001a0feb5643be3dc1afb2ac8e96feff8fbaf /src/selection-chemistry.cpp | |
| parent | recurse into groups when pasting lpe (diff) | |
| download | inkscape-6a9cf3b81e83a1ed4483e7dd51a3daae6e30647f.tar.gz inkscape-6a9cf3b81e83a1ed4483e7dd51a3daae6e30647f.zip | |
add delete lpe verb, rearrange menu to collect all lpe commands under path
(bzr r5120)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 3a7956595..501f334a2 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1382,6 +1382,44 @@ void sp_selection_paste_livepatheffect() _("Paste live path effect")); } + +void sp_selection_remove_livepatheffect_impl(SPItem *item) +{ + if ( item && SP_IS_SHAPE(item) ) { + sp_shape_remove_path_effect(SP_SHAPE(item)); + } else if (item && SP_IS_GROUP (item)) { + for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) { + if (!SP_IS_ITEM (child)) + continue; + sp_selection_remove_livepatheffect_impl (SP_ITEM(child)); + } + } +} + +void sp_selection_remove_livepatheffect() +{ + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if (desktop == NULL) return; + + Inkscape::Selection *selection = sp_desktop_selection(desktop); + + // check if something is selected + if (selection->isEmpty()) { + desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to remove live path effects from.")); + return; + } + + for ( GSList const *itemlist = selection->itemList(); itemlist != NULL; itemlist = g_slist_next(itemlist) ) { + SPItem *item = reinterpret_cast<SPItem*>(itemlist->data); + + sp_selection_remove_livepatheffect_impl(item); + + } + + sp_document_done(sp_desktop_document (desktop), SP_VERB_EDIT_PASTE_LIVEPATHEFFECT, + _("Remove live path effect")); +} + void sp_selection_paste_size (bool apply_x, bool apply_y) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; |
