X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Floadcanvas.cpp;h=200456ee4969b9e43edc06b16dcd7a0b2d02b052;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=f4a91c84ec31cca996a1943cb7222655d1bcd27d;hpb=bf92e1e2c959ab1fb668fa5a8274004a6f30a140;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp index f4a91c8..200456e 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.cpp +++ b/synfig-core/trunk/src/synfig/loadcanvas.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -87,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 ================================================= */ @@ -290,6 +293,15 @@ CanvasParser::parse_integer(xmlpp::Element *element) return atoi(val.c_str()); } +// see 'minor hack' at the end of parse_vector() below +// making this 'static' to give it file local scope +// stops it working (where working means working around +// bug #1509627) +Vector &canvas_parser_vector_id(Vector &vector) +{ + return vector; +} + Vector CanvasParser::parse_vector(xmlpp::Element *element) { @@ -332,7 +344,12 @@ CanvasParser::parse_vector(xmlpp::Element *element) else error_unexpected_element(child,child->get_name()); } - return vect; + // Minor hack - gcc 4.1.2 and earlier think that we're not using + // 'vect' and optimize it out at -O2 and higher. This convinces + // them that we are really using it. + return canvas_parser_vector_id(vect); + // When the bug is fixed, we can just do this instead: + // return vect; } Color @@ -841,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()); } @@ -874,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(); } @@ -1036,390 +1052,177 @@ CanvasParser::parse_animated(xmlpp::Element *element,Canvas::Handle canvas) else error_unexpected_element(child,child->get_name()); } - value_node->changed(); - return value_node; -} - -handle -CanvasParser::parse_subtract(xmlpp::Element *element,Canvas::Handle canvas) -{ - assert(element->get_name()=="subtract"); - handle value_node; - handle lhs,rhs,scalar; + // in canvas version 0.1, angles used to wrap, so to get from -179 + // degrees to 180 degrees meant a 1 degree change + // in canvas version 0.2 they don't, so that's a 359 degree change - if(element->get_attribute("type")) - { - ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value()); - - if(!type) - { - error(element,"Bad type in "); - return ValueNode_Subtract::Handle(); - } - value_node=ValueNode_Subtract::create(type); - } - else - value_node=ValueNode_Subtract::create(); - - if(!value_node) + // when loading a version 0.1 canvas, modify constant angle + // waypoints to that they are within 180 degrees of the previous + // waypoint's value + if (type == ValueBase::TYPE_ANGLE) { - error(element,strprintf(_("Unable to create "))); - return handle(); - } - - //if(element->get_attribute("scalar")) - //{ - // value_node->set_scalar(atof(element->get_attribute("scalar")->get_value().c_str())); - //} - - try - { - if(element->get_attribute("scalar")) - { - // This is for compatibility with older versions of the file format - String value(element->get_attribute("scalar")->get_value()); - if((value[0]<='9' && value[0]>='0') || value[0]=='-') - { - warning(element, _("Use of a real value where the ID should be is deprecated")); - value_node->set_scalar(atof(value.c_str())); - } - else - value_node->set_scalar(canvas->surefind_value_node(value)); - scalar=value_node->get_scalar(); - } - - if(element->get_attribute("lhs")) - { - lhs=canvas->surefind_value_node(element->get_attribute("lhs")->get_value()); - value_node->set_lhs(lhs); - } - - if(element->get_attribute("rhs")) - { - rhs=canvas->surefind_value_node(element->get_attribute("rhs")->get_value()); - value_node->set_rhs(rhs); - } - } - catch (Exception::IDNotFound) - { - error(element,"attribute in references unknown ID"); - } - catch (Exception::FileNotFound) - { - error(element,"Unable to open external file referenced in ID"); - } - - xmlpp::Element::NodeList list = element->get_children(); - for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) - { - xmlpp::Element *child(dynamic_cast(*iter)); - if(!child) - continue; - else - if(child->get_name()=="lhs") - { - if(lhs) - { - error(child,"LHS component of already defined!"); - continue; - } - - xmlpp::Element::NodeList list = child->get_children(); - xmlpp::Element::NodeList::iterator iter; - - // Search for the first non-text XML element - for(iter = list.begin(); iter != list.end(); ++iter) - if(dynamic_cast(*iter)) break; - - if(iter==list.end()) - { - error(child,_(" is missing its contents")); - continue; - } - - lhs=parse_value_node(dynamic_cast(*iter),canvas); - - if(lhs) - value_node->set_lhs(lhs); - else - { - error((*iter),"Parse of LHS ValueNode failed"); - } - - // \todo do a search for more elements and warn if they are found - } - else - if(child->get_name()=="rhs") + if (canvas->get_version() == "0.1") { - if(rhs) - { - error(child,"RHS component of already defined!"); - continue; - } - - xmlpp::Element::NodeList list = child->get_children(); - xmlpp::Element::NodeList::iterator iter; - - // Search for the first non-text XML element - for(iter = list.begin(); iter != list.end(); ++iter) - if(dynamic_cast(*iter)) break; - - if(iter==list.end()) - { - error(child,_(" is missing its contents")); - continue; - } - - rhs=parse_value_node(dynamic_cast(*iter),canvas); - - if(rhs) - value_node->set_rhs(rhs); - else - { - error((*iter),"Parse of RHS ValueNode failed"); - } - - // \todo do a search for more elements and warn if they are found - } - else - if(child->get_name()=="scalar") - { - if(scalar) - { - error(child,"scalar component of already defined!"); - continue; - } - - xmlpp::Element::NodeList list = child->get_children(); - xmlpp::Element::NodeList::iterator iter; - - // Search for the first non-text XML element - for(iter = list.begin(); iter != list.end(); ++iter) - if(dynamic_cast(*iter)) break; - - if(iter==list.end()) - { - error(child,_(" is missing its contents")); - continue; - } - - scalar=parse_value_node(dynamic_cast(*iter),canvas); - - if(scalar) - value_node->set_scalar(scalar); - else - { - error((*iter),"Parse of scalar ValueNode failed"); + bool first = true; + Real angle, prev = 0; + WaypointList &wl = value_node->waypoint_list(); + for (WaypointList::iterator iter = wl.begin(); iter != wl.end(); iter++) + { + angle = Angle::deg(iter->get_value(iter->get_time()).get(Angle())).get(); + if (first) + first = false; + else if (iter->get_value_node()->get_name() == "constant") + { + if (angle - prev > 180) + { + while (angle - prev > 180) angle -= 360; + iter->set_value(Angle::deg(angle)); + } + else if (prev - angle > 180) + { + while (prev - angle > 180) angle += 360; + iter->set_value(Angle::deg(angle)); + } + } + prev = angle; } - - // \todo do a search for more elements and warn if they are found } - else - error_unexpected_element(child,child->get_name()); } - if(!value_node->get_rhs() || !value_node->get_lhs() || !value_node->get_scalar()) - error(element," is missing LHS, RHS, or SCALAR"); - - if(value_node->get_rhs() == value_node->get_lhs()) - warning(element,"LHS is equal to RHS in , so this value_node will always be zero!"); - + value_node->changed(); return value_node; } etl::handle CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle canvas) { - handle value_node; - ValueBase::Type type; - // Determine the type - if(element->get_attribute("type")) + if(!element->get_attribute("type")) { - type=ValueBase::ident_type(element->get_attribute("type")->get_value()); - - if(!type) - { - error(element,"Bad type in ValueNode"); - return 0; - } + error(element, strprintf(_("Missing attribute \"type\" in <%s>"), element->get_name().c_str())); + return 0; } - else + + ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value()); + + if(!type) { - error(element,"Missing type in ValueNode"); + error(element, strprintf(_("Bad type in <%s>"), element->get_name().c_str())); return 0; } - value_node=LinkableValueNode::create(element->get_name(),type); + handle value_node=LinkableValueNode::create(element->get_name(),type); + handle c[value_node->link_count()]; 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; } if(value_node->get_type()!=type) { - error(element,"ValueNode did not accept type"); + error(element, strprintf(_("<%s> did not accept type '%s'"), + element->get_name().c_str(), + ValueBase::type_local_name(type).c_str())); return 0; } value_node->set_root_canvas(canvas->get_root()); - int i; - for(i=0;ilink_count();i++) + // handle exported valuenodes { - if(element->get_attribute(value_node->link_name(i))) - try { - String id(element->get_attribute(value_node->link_name(i))->get_value()); - - if(!value_node->set_link(i, - canvas->surefind_value_node( - id - ) - ) - ) error(element,strprintf(_("Unable to set link \"%s\" to ValueNode \"%s\" (link #%d in \"%s\")"),value_node->link_name(i).c_str(),id.c_str(),i,value_node->get_name().c_str())); - } - catch(Exception::IDNotFound) - { - error(element,"Unable to resolve "+element->get_attribute(value_node->link_name(i))->get_value()); - } - catch(Exception::FileNotFound) + int index; + String id, name; + xmlpp::Element::AttributeList attrib_list(element->get_attributes()); + for(xmlpp::Element::AttributeList::iterator iter = attrib_list.begin(); iter != attrib_list.end(); iter++) { - error(element,"Unable to open file referenced in "+element->get_attribute(value_node->link_name(i))->get_value()); - } - catch(...) - { - error(element,strprintf(_("Unknown Exception thrown when referencing ValueNode \"%s\""), - element->get_attribute(value_node->link_name(i))->get_value().c_str())); - throw; - } - } + name = (*iter)->get_name(); + id = (*iter)->get_value(); + if (name == "guid" || name == "id" || name == "type") + continue; + try { + index = value_node->get_link_index_from_name(name); - xmlpp::Element::NodeList list = element->get_children(); - for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) - { - xmlpp::Element *child(dynamic_cast(*iter)); - try - { - if(!child) - continue; - int index=value_node->get_link_index_from_name(child->get_name()); + if(c[index]) + { + error(element,strprintf(_("'%s' was already defined in <%s>"), + name.c_str(), + element->get_name().c_str())); + continue; + } - xmlpp::Element::NodeList list = child->get_children(); - xmlpp::Element::NodeList::iterator iter; + c[index] = canvas->surefind_value_node(id); - // Search for the first non-text XML element - for(iter = list.begin(); iter != list.end(); ++iter) - if(dynamic_cast(*iter)) break; + if (!c[index]) + { + error(element, strprintf(_("'%s' attribute in <%s> references unknown ID '%s'"), + name.c_str(), + element->get_name().c_str(), + id.c_str())); + continue; + } - if(iter==list.end()) + if(!value_node->set_link(index, c[index])) + { + error(element, strprintf(_("Unable to set link '\"%s\" to ValueNode \"%s\" (link #%d in \"%s\")"), + value_node->link_name(index).c_str(), + id.c_str(), + index, + element->get_name().c_str())); + continue; + } + + // printf(" <%s> set link %d (%s) using exported value\n", element->get_name().c_str(), index, name.c_str()); + } + catch (Exception::BadLinkName) { - error(child,_("element is missing its contents")); - continue; + warning(element, strprintf("Bad link name '%s'", name.c_str())); } - - ValueNode::Handle link=parse_value_node(dynamic_cast(*iter),canvas); - - if(!link) + catch(Exception::IDNotFound) { - error((*iter),"Parse of ValueNode failed"); + error(element,"Unable to resolve " + id); } - else - if(!value_node->set_link(index,link)) + catch(Exception::FileNotFound) { - //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(element,"Unable to open file referenced in " + id); } - - // \todo do a search for more elements and warn if they are found - - } - catch(Exception::BadLinkName) - { - error_unexpected_element(child,child->get_name()); - } - catch(...) - { - error(child,strprintf(_("Unknown Exception thrown when working on element \"%s\""),child->get_name().c_str())); - throw; - } - } - - return value_node; -} - -handle -CanvasParser::parse_composite(xmlpp::Element *element,Canvas::Handle canvas) -{ - assert(element->get_name()=="composite"); - - if(!element->get_attribute("type")) - { - error(element,"Missing attribute \"type\" in "); - return handle(); - } - - ValueBase::Type type=ValueBase::ident_type(element->get_attribute("type")->get_value()); - - if(!type) - { - error(element,"Bad type in "); - return handle(); - } - - handle value_node=ValueNode_Composite::create(type); - handle c[6]; - - if(!value_node) - { - error(element,strprintf(_("Unable to create "))); - return handle(); - } - - int i; - - for(i=0;ilink_count();i++) - { - string name=strprintf("c%d",i+1); - if(c[i]) - { - error(element,name+" was already defined in "); - continue; - } - if(element->get_attribute(name)) - { - c[i]=canvas->surefind_value_node(element->get_attribute(name)->get_value()); - if(c[i]) + catch(...) { - if(!value_node->set_link(i,c[i])) - { - error(element,'"'+name+"\" attribute in has bad type"); - } + error(element,strprintf(_("Unknown Exception thrown when referencing ValueNode \"%s\""), id.c_str())); + throw; } - else - error(element,'"'+name+"\" attribute in references unknown ID"); } } - xmlpp::Element::NodeList list = element->get_children(); - for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) + // handle inline valuenodes { - xmlpp::Element *child(dynamic_cast(*iter)); - if(!child) - continue; - else - for(i=0;ilink_count();i++) + int index; + String child_name; + xmlpp::Element::NodeList list = element->get_children(); + for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) { - string name=strprintf("c%d",i+1); - if(child->get_name()==name) + xmlpp::Element *child(dynamic_cast(*iter)); + try { - if(c[i]) + if(!child) + continue; + + child_name = child->get_name(); + + index = value_node->get_link_index_from_name(child_name); + + if(c[index]) { - error(child,name+" was already defined in "); + error(child, strprintf(_("'%s' was already defined in <%s>"), + child_name.c_str(), + element->get_name().c_str())); break; } @@ -1432,63 +1235,60 @@ CanvasParser::parse_composite(xmlpp::Element *element,Canvas::Handle canvas) if(iter==list.end()) { - error(child,strprintf(_("<%s> is missing its contents"),name.c_str())); - break; + error(child,strprintf(_("element <%s> is missing its contents"), + child_name.c_str())); + continue; } - c[i]=parse_value_node(dynamic_cast(*iter),canvas); + c[index]=parse_value_node(dynamic_cast(*iter),canvas); - if(!c[i]) + if(!c[index]) { - error((*iter),"Parse of "+name+" ValueNode failed"); - break; + error((*iter),strprintf(_("Parse of '%s' failed"), + child_name.c_str())); + continue; } - if(!value_node->set_link(i,c[i])) + if(!value_node->set_link(index,c[index])) { - error(child,strprintf(_("<%s> has a bad value"),name.c_str())); - break; + error(child,strprintf(_("Unable to connect value node ('%s' of type '%s') to link %d (%s)"), + c[index]->get_name().c_str(), + ValueBase::type_local_name(c[index]->get_type()).c_str(), + index, + value_node->link_name(index).c_str())); + continue; } // \todo do a search for more elements and warn if they are found - break; + + // printf(" <%s> set link %d (%s) using inline value\n", element->get_name().c_str(), index, child_name.c_str()); + } + catch(Exception::BadLinkName) + { + warning(child, strprintf("Bad link name for <%s>", element->get_name().c_str())); + } + catch(...) + { + error(child, strprintf(_("Unknown Exception thrown when working on element \"%s\""),child_name.c_str())); + throw; } } - // somewhat of a hack, but it works - if(i==value_node->link_count()) error_unexpected_element(child,child->get_name()); } - switch(value_node->link_count()) + for (int i = 0; i < value_node->link_count(); i++) { - case 1: - if(!value_node->get_link(0)) - { - error(element," is missing parameters"); - return handle(); - } - break; - case 2: - if(!value_node->get_link(0) ||!value_node->get_link(1)) - { - error(element," is missing parameters"); - return handle(); - } - break; - case 3: - if(!value_node->get_link(0) ||!value_node->get_link(1) ||!value_node->get_link(2)) - { - error(element," is missing parameters"); - return handle(); - } - break; - case 4: - if(!value_node->get_link(0) ||!value_node->get_link(1) ||!value_node->get_link(2) ||!value_node->get_link(3)) + if (!c[i] && + // the 'width' parameter of wasn't always present, so it won't be in old .sif files + !(element->get_name() == "stripes" && value_node->link_name(i) == "width")) { - error(element," is missing parameters"); - return handle(); + error(element, strprintf(_("<%s> is missing link %d (%s)"), + element->get_name().c_str(), + i, + value_node->link_name(i).c_str())); + return 0; } - break; - } + } + return value_node; } @@ -1723,7 +1523,7 @@ CanvasParser::parse_value_node(xmlpp::Element *element,Canvas::Handle canvas) return value_node; } - // If ValueBase::ident_type() recognises the name, then we know it's a ValueBase + // If ValueBase::ident_type() recognizes the name, then we know it's a ValueBase if(element->get_name()!="canvas" && ValueBase::ident_type(element->get_name())) { ValueBase data=parse_value(element,canvas); @@ -1745,12 +1545,6 @@ CanvasParser::parse_value_node(xmlpp::Element *element,Canvas::Handle canvas) if(element->get_name()=="hermite" || element->get_name()=="animated") value_node=parse_animated(element,canvas); else - if(element->get_name()=="subtract") - value_node=parse_subtract(element,canvas); - else - if(element->get_name()=="composite") - value_node=parse_composite(element,canvas); - else if(element->get_name()=="dynamic_list") value_node=parse_dynamic_list(element,canvas); else @@ -1758,20 +1552,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 @@ -1850,7 +1647,7 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas) { String version(element->get_attribute("version")->get_value()); if(version>layer->get_version()) - warning(element,_("Installed layer version is larger than layer version in file")); + warning(element,_("Installed layer version is smaller than layer version in file")); if(version!=layer->get_version()) layer->set_version(version); } @@ -1897,7 +1694,9 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas) String str= child->get_attribute("use")->get_value(); - if(layer->get_param(param_name).get_type()==ValueBase::TYPE_CANVAS) + if (str.empty()) + error(child,_("Empty use=\"\" value in ")); + else if(layer->get_param(param_name).get_type()==ValueBase::TYPE_CANVAS) { if(!layer->set_param(param_name,canvas->surefind_canvas(str))) error((*iter),_("Layer rejected canvas link")); @@ -1932,7 +1731,7 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas) continue; } - // If we recognise the element name as a + // If we recognize the element name as a // ValueBase, then treat is at one if(/*(*iter)->get_name()!="canvas" && */ValueBase::ident_type((*iter)->get_name()) && !dynamic_cast(*iter)->get_attribute("guid")) { @@ -2031,6 +1830,11 @@ CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool in canvas->set_guid(guid); } + if(element->get_attribute("version")) + canvas->set_version(element->get_attribute("version")->get_value()); + else if(parent) + canvas->set_version(parent->get_version()); + if(element->get_attribute("width")) canvas->rend_desc().set_w(atoi(element->get_attribute("width")->get_value().c_str())); @@ -2165,7 +1969,7 @@ CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool in // If we don't have any name, warn if(list.empty()) - warning(child,_("blank \"name\" entitity")); + warning(child,_("blank \"name\" entity")); string tmp; for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) @@ -2180,7 +1984,7 @@ CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool in // If we don't have any description, warn if(list.empty()) - warning(child,_("blank \"desc\" entitity")); + warning(child,_("blank \"desc\" entity")); string tmp; for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) @@ -2195,7 +1999,7 @@ CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool in // If we don't have any description, warn if(list.empty()) - warning(child,_("blank \"author\" entitity")); + warning(child,_("blank \"author\" entity")); string tmp; for(xmlpp::Element::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) @@ -2220,9 +2024,20 @@ CanvasParser::parse_canvas(xmlpp::Element *element,Canvas::Handle parent,bool in if(canvas->value_node_list().placeholder_count()) { - error(element,strprintf(_("Canvas %s has undefined ValueNodes"),canvas->get_id().c_str())); + String nodes; + for (ValueNodeList::const_iterator iter = canvas->value_node_list().begin(); iter != canvas->value_node_list().end(); iter++) + if(PlaceholderValueNode::Handle::cast_dynamic(*iter)) + { + if (nodes != "") nodes += ", "; + nodes += "'" + (*iter)->get_id() + "'"; + } + error(element,strprintf(_("Canvas '%s' has undefined %s: %s"), + canvas->get_id().c_str(), + canvas->value_node_list().placeholder_count() == 1 ? _("ValueNode") : _("ValueNodes"), + nodes.c_str())); } + canvas->set_version(CURRENT_CANVAS_VERSION); return canvas; } @@ -2235,7 +2050,6 @@ CanvasParser::parse_from_file(const String &file) Canvas::Handle CanvasParser::parse_from_file_as(const String &file_,const String &as_) { - CHECK_EXPIRE_TIME(); try { ChangeLocale change_locale(LC_NUMERIC, "C"); @@ -2296,8 +2110,6 @@ CanvasParser::parse_from_file_as(const String &file_,const String &as_) Canvas::Handle CanvasParser::parse_from_string(const String &data) { - CHECK_EXPIRE_TIME(); - try { ChangeLocale change_locale(LC_NUMERIC, "C");