From b802808a0226a87371021393c4f1da776aa6a6ad Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sat, 14 Jun 2008 16:25:16 +0000 Subject: [PATCH] put exception catch block around all doEffect calls. (so in SP_LPE_ITEM) --- src/live_effects/effect.cpp | 17 ++--------------- src/sp-lpe-item.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 6103a3d18..551b23a1d 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -21,8 +21,6 @@ #include #include "pen-context.h" #include "tools-switch.h" -#include "message-stack.h" -#include "desktop.h" #include "live_effects/lpeobject.h" #include "live_effects/parameter/parameter.h" @@ -279,20 +277,9 @@ Effect::acceptParamPath (SPPath *param_path) { void Effect::doEffect (SPCurve * curve) { - NArtBpath const *bpath_in = curve->get_bpath(); - - std::vector result_pathv; + std::vector orig_pathv = curve->get_pathvector(); - try { - std::vector orig_pathv = BPath_to_2GeomPath(bpath_in); - - result_pathv = doEffect_path(orig_pathv); - } - catch (std::exception & e) { - g_warning("Exception during LPE %s execution. \n %s", getName().c_str(), e.what()); - SP_ACTIVE_DESKTOP->messageStack()->flash( Inkscape::WARNING_MESSAGE, - _("An exception occurred during execution of the Path Effect.") ); - } + std::vector result_pathv = doEffect_path(orig_pathv); curve->set_pathv(result_pathv); } diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 470e97d19..abcf00ad2 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -29,6 +29,9 @@ #include "sp-lpe-item.h" #include "xml/repr.h" #include "uri.h" +#include "message-stack.h" +#include "inkscape.h" +#include "desktop.h" #include @@ -299,7 +302,14 @@ void sp_lpe_item_perform_path_effect(SPLPEItem *lpeitem, SPCurve *curve) { lpe->doBeforeEffect(lpeitem); } - lpe->doEffect(curve); + try { + lpe->doEffect(curve); + } + catch (std::exception & e) { + g_warning("Exception during LPE %s execution. \n %s", lpe->getName().c_str(), e.what()); + SP_ACTIVE_DESKTOP->messageStack()->flash( Inkscape::WARNING_MESSAGE, + _("An exception occurred during execution of the Path Effect.") ); + } } } } -- 2.30.2