From 01225070a051a96818fd9d0c218cafb982cdce21 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 29 Oct 2017 13:56:41 +0100 Subject: Fix a bug converting to paths nested LPE with powerstroke --- src/live_effects/lpe-powerstroke.cpp | 2 +- src/path-chemistry.cpp | 8 ++++++-- src/sp-lpe-item.cpp | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index 6576e6a62..8066ade61 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -255,7 +255,7 @@ LPEPowerStroke::doOnApply(SPLPEItem const* lpeitem) void LPEPowerStroke::doOnRemove(SPLPEItem const* lpeitem) { - if (SP_IS_SHAPE(lpeitem)) { + if (SP_IS_SHAPE(lpeitem) && !keep_paths) { SPLPEItem *item = const_cast(lpeitem); SPCSSAttr *css = sp_repr_css_attr_new (); if (lpeitem->style->fill.isPaintserver()) { diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 67a742ed2..b3b0c8076 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -398,9 +398,13 @@ sp_item_list_to_curves(const std::vector &items, std::vector& continue; } - + + SPLPEItem *lpeitem = dynamic_cast(item); + if (lpeitem) { + lpeitem->removeAllPathEffects(true); + } + if (group) { - group->removeAllPathEffects(true); std::vector item_list = sp_item_group_item_list(group); std::vector item_to_select; diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index c0688f869..5be950afa 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -604,9 +604,9 @@ void SPLPEItem::removeAllPathEffects(bool keep_paths) } // unlink and delete all references in the list (*it)->unlink(); - delete *it; - it = this->path_effect_list->erase(it); + ++it; } + this->path_effect_list->clear(); this->getRepr()->setAttribute("inkscape:path-effect", NULL); if (!keep_paths) { -- cgit v1.2.3