Code

Fix wrong identification of invalid effects (for unknown effects, it used to default...
authorjohanengelen <johanengelen@users.sourceforge.net>
Wed, 6 Feb 2008 22:47:05 +0000 (22:47 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Wed, 6 Feb 2008 22:47:05 +0000 (22:47 +0000)
src/live_effects/lpeobject.cpp

index bcb01463a741e609253fc29149996df32576424c..e7810fc28a81f0b6ccb6f8813c0df292ca8956c7 100644 (file)
@@ -182,11 +182,9 @@ livepatheffect_set(SPObject *object, unsigned key, gchar const *value)
                 lpeobj->lpe = NULL;
             }
 
-            if (value) {
+            if ( value && Inkscape::LivePathEffect::LPETypeConverter.is_valid_key(value) ) {
                 lpeobj->effecttype = Inkscape::LivePathEffect::LPETypeConverter.get_id_from_key(value);
-                if (lpeobj->effecttype != Inkscape::LivePathEffect::INVALID_LPE) {
-                    lpeobj->lpe = Inkscape::LivePathEffect::Effect::New(lpeobj->effecttype, lpeobj);
-                }
+                lpeobj->lpe = Inkscape::LivePathEffect::Effect::New(lpeobj->effecttype, lpeobj);
                 lpeobj->effecttype_set = true;
             } else {
                 lpeobj->effecttype = Inkscape::LivePathEffect::INVALID_LPE;