X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Floadcanvas.cpp;h=fa5eb406fac9aa1d67212b4345cf644ddbf878d2;hb=dbda39a6a78b7dd7fb9d2b0b784c4ff17d59e42d;hp=5e5d0d3d3d2e9b5ccb99551391567a147d1a955c;hpb=a532eda73076926167d4e255c4bcbbe342978747;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp index 5e5d0d3..fa5eb40 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.cpp +++ b/synfig-core/trunk/src/synfig/loadcanvas.cpp @@ -88,6 +88,8 @@ test_class test_class_instance; /* === M A C R O S ========================================================= */ +#define VALUENODE_COMPATIBILITY_URL "http://synfig.org/Convert#Compatibility" + inline bool is_whitespace(char x) { return ((x)=='\n' || (x)=='\t' || (x)==' '); } /* === P R O C E D U R E S ================================================= */ @@ -856,7 +858,6 @@ CanvasParser::parse_value(xmlpp::Element *element,Canvas::Handle canvas) return ValueBase(parse_canvas(element,canvas,true)); else { - DEBUGPOINT(); error_unexpected_element(element,element->get_name()); } @@ -889,7 +890,7 @@ CanvasParser::parse_animated(xmlpp::Element *element,Canvas::Handle canvas) if(!value_node) { - error(element,strprintf(_("Unable to create with type \"%s\""),ValueBase::type_name(type).c_str())); + error(element,strprintf(_("Unable to create with type \"%s\""),ValueBase::type_local_name(type).c_str())); return ValueNode_Animated::Handle(); } @@ -1122,7 +1123,10 @@ CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle c if(!value_node) { - error(element,"Unknown ValueNode type "+element->get_name()); + error(element, strprintf(_("Error creating ValueNode <%s> with type '%s'. Refer to '%s'"), + element->get_name().c_str(), + ValueBase::type_local_name(type).c_str(), + VALUENODE_COMPATIBILITY_URL)); return 0; } @@ -1198,8 +1202,8 @@ CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle c else if(!value_node->set_link(index,link)) { - //error(dynamic_cast(*iter),strprintf("Unable to connect value node ('%s' of type '%s') to link %d",link->get_name().c_str(),ValueBase::type_name(link->get_type()).c_str(),index)); - error(element,strprintf("Unable to connect value node ('%s' of type '%s') to link %d",link->get_name().c_str(),ValueBase::type_name(link->get_type()).c_str(),index)); + //error(dynamic_cast(*iter),strprintf(_("Unable to connect value node ('%s' of type '%s') to link %d"),link->get_name().c_str(),ValueBase::type_local_name(link->get_type()).c_str(),index)); + error(element,strprintf(_("Unable to connect value node ('%s' of type '%s') to link %d"),link->get_name().c_str(),ValueBase::type_local_name(link->get_type()).c_str(),index)); } // \todo do a search for more elements and warn if they are found @@ -1622,21 +1626,23 @@ CanvasParser::parse_value_node(xmlpp::Element *element,Canvas::Handle canvas) value_node=parse_dynamic_list(element,canvas); else if(LinkableValueNode::book().count(element->get_name())) + { value_node=parse_linkable_value_node(element,canvas); + if (!value_node) value_node = PlaceholderValueNode::create(); + } else if(element->get_name()=="canvas") value_node=ValueNode_Const::create(parse_canvas(element,canvas,true)); else { error_unexpected_element(element,element->get_name()); - error(element, "Expected a ValueNode"); + error(element, strprintf(_("Expected a ValueNode. Refer to '%s'"), + VALUENODE_COMPATIBILITY_URL)); value_node=PlaceholderValueNode::create(); } - value_node->set_root_canvas(canvas->get_root()); - // If we were successful, and our element has // an ID attribute, go ahead and add it to the // value_node list