From 72b7b31db250f20b90730d2888e6a554b434a407 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 27 Jul 2008 21:58:25 +0000 Subject: [PATCH] remove dependency on INVALID_LPE a bit --- src/live_effects/effect.cpp | 6 +++--- src/live_effects/effect.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 8b690bc44..289d22172 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -70,7 +70,7 @@ namespace Inkscape { namespace LivePathEffect { -const Util::EnumData LPETypeData[INVALID_LPE] = { +const Util::EnumData LPETypeData[] = { // {constant defined in effect.h, N_("name of your effect"), "name of your effect in SVG"} {ANGLE_BISECTOR, N_("Angle bisector"), "angle_bisector"}, {BEND_PATH, N_("Bend"), "bend_path"}, @@ -101,7 +101,7 @@ const Util::EnumData LPETypeData[INVALID_LPE] = { {TANGENT_TO_CURVE, N_("Tangent to curve"), "tangent_to_curve"}, {VONKOCH, N_("VonKoch"), "vonkoch"}, }; -const Util::EnumDataConverter LPETypeConverter(LPETypeData, INVALID_LPE); +const Util::EnumDataConverter LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData)); Effect* Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) @@ -243,7 +243,7 @@ Effect::~Effect() Glib::ustring Effect::getName() { - if (lpeobj->effecttype_set && lpeobj->effecttype < INVALID_LPE) + if (lpeobj->effecttype_set && LPETypeConverter.is_valid_id(lpeobj->effecttype) ) return Glib::ustring( _(LPETypeConverter.get_label(lpeobj->effecttype).c_str()) ); else return Glib::ustring( _("No effect") ); diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 4b6099656..b6386169c 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -82,7 +82,7 @@ enum EffectType { INVALID_LPE // This must be last }; -extern const Util::EnumData LPETypeData[INVALID_LPE]; +extern const Util::EnumData LPETypeData[]; extern const Util::EnumDataConverter LPETypeConverter; enum LPEPathFlashType { -- 2.30.2