From: cilix42 Date: Mon, 18 Aug 2008 00:32:47 +0000 (+0000) Subject: reimplement acceptsNumParams(); instead of making it a virtual function we just make... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a45e91fd09273632e9acf849bb72621832156f07;p=inkscape.git reimplement acceptsNumParams(); instead of making it a virtual function we just make case distinctions --- diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 3f12345ae..1308a1860 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -107,6 +107,17 @@ const Util::EnumData LPETypeData[] = { }; const Util::EnumDataConverter LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData)); +int +Effect::acceptsNumParams(EffectType type) { + switch (type) { + case ANGLE_BISECTOR: return 3; + case PERP_BISECTOR: return 2; + case CIRCLE_3PTS: return 3; + case CIRCLE_WITH_RADIUS: return 2; + default: return 0; + } +} + Effect* Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) { diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index c01cab5c3..1bc3988ab 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -109,7 +109,8 @@ public: void writeParamsToSVG(); virtual void acceptParamPath (SPPath *param_path); - virtual int acceptsNumParams() { return 0; } + static int acceptsNumParams(EffectType type); + int acceptsNumParams() { return acceptsNumParams(effectType()); } void doAcceptPathPreparations(SPLPEItem *lpeitem); inline bool pathParamAccepted() { return done_pathparam_set; }