diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2010-03-14 17:59:51 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2010-03-14 17:59:51 +0000 |
| commit | b11b62ddd952a15b0e3f1192c38f3ca15d1197f8 (patch) | |
| tree | 81780525416b938689fa0e85aaa9256d459f601f /src/path-chemistry.cpp | |
| parent | Implement keyboard shortcuts for single handle adjustments. (diff) | |
| download | inkscape-b11b62ddd952a15b0e3f1192c38f3ca15d1197f8.tar.gz inkscape-b11b62ddd952a15b0e3f1192c38f3ca15d1197f8.zip | |
fix pasting of LPE stacks
Fixed bugs:
- https://launchpad.net/bugs/290834
(bzr r9191)
Diffstat (limited to 'src/path-chemistry.cpp')
| -rw-r--r-- | src/path-chemistry.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 50d26ba64..c44ab5bc6 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -323,8 +323,33 @@ sp_selected_path_to_curves(SPDesktop *desktop, bool interactive) } } +/** Converts the selected items to LPEItems if they are not already so; e.g. SPRects) */ +void sp_selected_to_lpeitems(SPDesktop *desktop) +{ + Inkscape::Selection *selection = sp_desktop_selection(desktop); + + if (selection->isEmpty()) { + return; + } + + bool did = false; + + GSList *selected = g_slist_copy((GSList *) selection->itemList()); + GSList *to_select = NULL; + selection->clear(); + GSList *items = g_slist_copy(selected); + + did = sp_item_list_to_curves(items, &selected, &to_select, true); + + g_slist_free (items); + selection->setReprList(to_select); + selection->addList(selected); + g_slist_free (to_select); + g_slist_free (selected); +} + bool -sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_select) +sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_select, bool skip_all_lpeitems) { bool did = false; @@ -335,6 +360,13 @@ sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_selec SPItem *item = SP_ITEM(items->data); SPDocument *document = item->document; + if ( skip_all_lpeitems && + SP_IS_LPE_ITEM(item) && + !SP_IS_GROUP(item) ) // also convert objects in an SPGroup when skip_all_lpeitems is set. + { + continue; + } + if (SP_IS_PATH(item) && !SP_PATH(item)->original_curve) { continue; // already a path, and no path effect } |
