From 253da39319875724ef7345f8cc14ac75a31a4f2d Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 6 Jan 2016 13:40:41 +0100 Subject: Fix crash when apply Bend From Clipboard to a clone by the pen/pencil toolbar (bzr r14563) --- src/ui/tools/freehand-base.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ui/tools/freehand-base.cpp') diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index a889a12e6..613857626 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -42,6 +42,7 @@ #include "selection-chemistry.h" #include "snap.h" #include "sp-path.h" +#include "sp-use.h" #include "sp-namedview.h" #include "live_effects/lpe-powerstroke.h" #include "style.h" @@ -271,7 +272,11 @@ static void spdc_apply_powerstroke_shape(const std::vector & points static void spdc_apply_bend_shape(gchar const *svgd, FreehandBase *dc, SPItem *item) { using namespace Inkscape::LivePathEffect; - if(!SP_LPE_ITEM(item)->hasPathEffectOfType(BEND_PATH)){ + SPUse *use = dynamic_cast(item); + if ( use ) { + return; + } + if(!SP_IS_LPE_ITEM(item) || !SP_LPE_ITEM(item)->hasPathEffectOfType(BEND_PATH)){ Effect::createAndApply(BEND_PATH, dc->desktop->doc(), item); } Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE(); -- cgit v1.2.3