From: buliabyak Date: Thu, 26 Mar 2009 22:58:37 +0000 (+0000) Subject: sp_lpe_item_has_path_effect now returns false if one of the effects in the stack... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ba387fec25883c72319bf6107eab9e5def453e3e;p=inkscape.git sp_lpe_item_has_path_effect now returns false if one of the effects in the stack is invalid or unsupported, in which case LPE stack is disabled --- diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index f1e4c96c2..90e9b2d6d 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -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)