Fix a bug introduced in SVN r2014. The 'origin' parameter of regions and outlines...
[synfig.git] / synfig-core / trunk / src / synfig / loadcanvas.cpp
index 402c0e0..d93dc09 100644 (file)
@@ -995,7 +995,7 @@ CanvasParser::parse_animated(xmlpp::Element *element,Canvas::Handle canvas)
                        if(child->get_attribute("temporal-tension"))
                        {
                                synfig::String str(child->get_attribute("temporal-tension")->get_value());
-                               waypoint->set_time_tension(atof(str.c_str()));
+                               waypoint->set_temporal_tension(atof(str.c_str()));
                        }
                        if(child->get_attribute("continuity"))
                        {
@@ -1292,6 +1292,18 @@ CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle c
                                 value_node->link_name(i) == "fixed_length"))
                                continue;
 
+                       // 'scale' was added while canvas version 0.5 was in use
+                       if ((version == "0.3" || version == "0.4" || version == "0.5") &&
+                               element->get_name() == "blinecalcwidth" &&
+                               value_node->link_name(i) == "scale")
+                               continue;
+
+                       // 'loop' was added while canvas version 0.5 was in use, as was the 'gradientcolor' node type
+                       if (version == "0.5" &&
+                               element->get_name() == "gradientcolor" &&
+                               value_node->link_name(i) == "loop")
+                               continue;
+
                        error(element, strprintf(_("<%s> is missing link %d (%s)"),
                                                                         element->get_name().c_str(),
                                                                         i,
@@ -1707,6 +1719,11 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas)
 
                        String param_name=child->get_attribute("name")->get_value();
 
+                       // SVN r2013 and r2014 renamed all 'pos' and 'offset' parameters to 'origin'
+                       // 'pos' and 'offset' will appear in old .sif files; handle them correctly
+                       if (param_name == "pos" || param_name == "offset")
+                               param_name = "origin";
+
                        if(child->get_attribute("use"))
                        {
                                // If the "use" attribute is used, then the
@@ -1776,7 +1793,9 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas)
                                // the layer liked it
                                if(!layer->set_param(param_name,data))
                                {
-                                       warning((*iter),_("Layer rejected value for <param>"));
+                                       warning((*iter),strprintf(_("Layer '%s' rejected value for parameter '%s'"),
+                                                                                         element->get_attribute("type")->get_value().c_str(),
+                                                                                         param_name.c_str()));
                                        continue;
                                }
                        }