From fe852ad9c0a418d34cc1356b30c6fb146d189ad9 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 3 Sep 2007 11:05:50 +0000 Subject: [PATCH] Completes fix of 1785296: If a waypoint has , then just save a reference to the canvas rather than duplicating the entire canvas in the .sif file. The canvas will have already been written to the section so we don't need to write it again. git-svn-id: http://svn.voria.com/code@574 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/savecanvas.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/synfig-core/trunk/src/synfig/savecanvas.cpp b/synfig-core/trunk/src/synfig/savecanvas.cpp index 6129f71..cb47847 100644 --- a/synfig-core/trunk/src/synfig/savecanvas.cpp +++ b/synfig-core/trunk/src/synfig/savecanvas.cpp @@ -268,8 +268,18 @@ xmlpp::Element* encode_animated(xmlpp::Element* root,ValueNode_Animated::ConstHa //waypoint_node->add_child(encode_value(iter->get_value(),canvas)); if(iter->get_value_node()->is_exported()) waypoint_node->set_attribute("use",iter->get_value_node()->get_relative_id(canvas)); - else - encode_value_node(waypoint_node->add_child("value_node"),iter->get_value_node(),canvas); + else { + ValueNode::ConstHandle value_node = iter->get_value_node(); + if(ValueNode_Const::ConstHandle::cast_dynamic(value_node)) { + const ValueBase data = ValueNode_Const::ConstHandle::cast_dynamic(value_node)->get_value(); + if (data.get_type() == ValueBase::TYPE_CANVAS) + waypoint_node->set_attribute("use",data.get(Canvas::Handle()).get()->get_relative_id(canvas)); + else + encode_value_node(waypoint_node->add_child("value_node"),iter->get_value_node(),canvas); + } + else + encode_value_node(waypoint_node->add_child("value_node"),iter->get_value_node(),canvas); + } switch(iter->get_before()) { -- 2.7.4