diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 90e9b2d6d62e18057b40c46c71177d811b5362ef..e4d278e34157df42bd7f0183b89e57da96430901 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -283,11 +283,13 @@ sp_lpe_item_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
{
SPLPEItem *lpeitem = (SPLPEItem *) object;
- if ( sp_lpe_item_has_path_effect(lpeitem) ) {
- std::string href = patheffectlist_write_svg(*lpeitem->path_effect_list);
- repr->setAttribute("inkscape:path-effect", href.c_str());
- } else {
- repr->setAttribute("inkscape:path-effect", NULL);
+ if (flags & SP_OBJECT_WRITE_EXT) {
+ if ( sp_lpe_item_has_path_effect(lpeitem) ) {
+ std::string href = patheffectlist_write_svg(*lpeitem->path_effect_list);
+ repr->setAttribute("inkscape:path-effect", href.c_str());
+ } else {
+ repr->setAttribute("inkscape:path-effect", NULL);
+ }
}
if (((SPObjectClass *)(parent_class))->write) {
sp_lpe_item_cleanup_original_path_recursive(lpeitem);
}
+/** used for shapes so they can see if they should also disable shape calculation and read from d= */
+bool sp_lpe_item_has_broken_path_effect(SPLPEItem *lpeitem)
+{
+ if (lpeitem->path_effect_list->empty())
+ return false;
+
+ // go through the list; if some are unknown or invalid, return true
+ 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 true;
+ }
+
+ return false;
+}
+
bool sp_lpe_item_has_path_effect(SPLPEItem *lpeitem)
{