Code

sp_lpe_item_has_path_effect now returns false if one of the effects in the stack...
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 26 Mar 2009 22:58:37 +0000 (22:58 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 26 Mar 2009 22:58:37 +0000 (22:58 +0000)
src/sp-lpe-item.cpp

index f1e4c96c28bc4949299f1659c912e100cab7c677..90e9b2d6d62e18057b40c46c71177d811b5362ef 100644 (file)
@@ -601,7 +601,19 @@ void sp_lpe_item_up_current_path_effect(SPLPEItem *lpeitem)
 
 bool sp_lpe_item_has_path_effect(SPLPEItem *lpeitem)
 {
-    return !lpeitem->path_effect_list->empty();
+    if (lpeitem->path_effect_list->empty())
+        return false;
+
+    // go through the list; if some are unknown or invalid, we are not an LPE item!
+    PathEffectList effect_list =  sp_lpe_item_get_effect_list(lpeitem);
+    for (PathEffectList::iterator it = effect_list.begin(); it != effect_list.end(); it++)
+    {
+        LivePathEffectObject *lpeobj = (*it)->lpeobject;
+        if (!lpeobj || !lpeobj->get_lpe())
+            return false;
+    }
+
+    return true;
 }
 
 bool sp_lpe_item_has_path_effect_recursive(SPLPEItem *lpeitem)