From 6560846b17d7898c6c98398c7dda55ec1cbcaa74 Mon Sep 17 00:00:00 2001 From: pabs Date: Sat, 3 Feb 2007 23:49:50 +0000 Subject: [PATCH] Fix 1380227: crash when changing keyframes. Patch by Chris Moore (dooglus) git-svn-id: http://svn.voria.com/code@234 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/synfigapp/actions/keyframeduplicate.cpp | 14 +++++++------- .../trunk/src/synfigapp/actions/keyframeremove.cpp | 14 +++++++------- .../trunk/src/synfigapp/actions/keyframeset.cpp | 18 +++++++++--------- synfig-studio/trunk/src/synfigapp/canvasinterface.cpp | 8 ++++---- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp index 94bf215..eb8493e 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/keyframeduplicate.cpp @@ -164,13 +164,13 @@ Action::KeyframeDuplicate::process_value_desc(const synfigapp::ValueDesc& value_ // If we are a dynamic list, then we need to update the ActivePoints if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)) { - ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node)); + ValueNode_DynamicList::Handle value_node_dynamic(ValueNode_DynamicList::Handle::cast_dynamic(value_node)); int i; - for(i=0;ilink_count();i++) + for(i=0;ilink_count();i++) { - synfigapp::ValueDesc value_desc(value_node,i); - Activepoint activepoint(value_node->list[i].new_activepoint_at_time(old_time)); + synfigapp::ValueDesc value_desc(value_node_dynamic,i); + Activepoint activepoint(value_node_dynamic->list[i].new_activepoint_at_time(old_time)); activepoint.set_time(new_time); Action::Handle action(ActivepointSetSmart::create()); @@ -189,15 +189,15 @@ Action::KeyframeDuplicate::process_value_desc(const synfigapp::ValueDesc& value_ } else if(ValueNode_Animated::Handle::cast_dynamic(value_node)) { - ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node)); - Waypoint waypoint(value_node->new_waypoint_at_time(old_time)); + ValueNode_Animated::Handle value_node_animated(ValueNode_Animated::Handle::cast_dynamic(value_node)); + Waypoint waypoint(value_node_animated->new_waypoint_at_time(old_time)); waypoint.set_time(new_time); Action::Handle action(WaypointSetSmart::create()); action->set_param("canvas",get_canvas()); action->set_param("canvas_interface",get_canvas_interface()); - action->set_param("value_node",ValueNode::Handle(value_node)); + action->set_param("value_node",ValueNode::Handle(value_node_animated)); action->set_param("waypoint",waypoint); assert(action->is_ready()); diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp index d6915f5..b1a14da 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/keyframeremove.cpp @@ -142,15 +142,15 @@ Action::KeyframeRemove::process_value_desc(const synfigapp::ValueDesc& value_des // If we are a dynamic list, then we need to update the ActivePoints if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)) { - ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node)); + ValueNode_DynamicList::Handle value_node_dynamic(ValueNode_DynamicList::Handle::cast_dynamic(value_node)); int i; - for(i=0;ilink_count();i++) + for(i=0;ilink_count();i++) try { Activepoint activepoint; - activepoint=*value_node->list[i].find(time); + activepoint=*value_node_dynamic->list[i].find(time); - synfigapp::ValueDesc value_desc(value_node,i); + synfigapp::ValueDesc value_desc(value_node_dynamic,i); Action::Handle action(ActivepointRemove::create()); @@ -172,16 +172,16 @@ Action::KeyframeRemove::process_value_desc(const synfigapp::ValueDesc& value_des else if(ValueNode_Animated::Handle::cast_dynamic(value_node)) try { - ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node)); + ValueNode_Animated::Handle value_node_animated(ValueNode_Animated::Handle::cast_dynamic(value_node)); Waypoint waypoint; - waypoint=*value_node->find(time); + waypoint=*value_node_animated->find(time); assert(waypoint.get_time()==time); Action::Handle action(WaypointRemove::create()); action->set_param("canvas",get_canvas()); action->set_param("canvas_interface",get_canvas_interface()); - action->set_param("value_node",ValueNode::Handle(value_node)); + action->set_param("value_node",ValueNode::Handle(value_node_animated)); action->set_param("waypoint",waypoint); assert(action->is_ready()); diff --git a/synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp b/synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp index a2b2a84..bfbee21 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/keyframeset.cpp @@ -275,11 +275,11 @@ Action::KeyframeSet::process_value_desc(const synfigapp::ValueDesc& value_desc) // If we are a dynamic list, then we need to update the ActivePoints if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)) { - ValueNode_DynamicList::Handle value_node(ValueNode_DynamicList::Handle::cast_dynamic(value_node)); + ValueNode_DynamicList::Handle value_node_dynamic(ValueNode_DynamicList::Handle::cast_dynamic(value_node)); int i; - for(i=0;ilink_count();i++) + for(i=0;ilink_count();i++) { - synfigapp::ValueDesc value_desc(value_node,i); + synfigapp::ValueDesc value_desc(value_node_dynamic,i); if(new_time>keyframe_prev && new_timelist[i].find(old_time); + activepoint=*value_node_dynamic->list[i].find(old_time); activepoint.set_time(new_time); } catch(...) { activepoint.set_time(new_time); - activepoint.set_state(value_node->list[i].status_at_time(old_time)); + activepoint.set_state(value_node_dynamic->list[i].status_at_time(old_time)); activepoint.set_priority(0); } action->set_param("activepoint",activepoint); @@ -330,24 +330,24 @@ Action::KeyframeSet::process_value_desc(const synfigapp::ValueDesc& value_desc) } //else { - ValueNode_Animated::Handle value_node(ValueNode_Animated::Handle::cast_dynamic(value_node)); + ValueNode_Animated::Handle value_node_animated(ValueNode_Animated::Handle::cast_dynamic(value_node)); Action::Handle action(WaypointSetSmart::create()); action->set_param("canvas",get_canvas()); action->set_param("canvas_interface",get_canvas_interface()); - action->set_param("value_node",ValueNode::Handle(value_node)); + action->set_param("value_node",ValueNode::Handle(value_node_animated)); Waypoint waypoint; try { - waypoint=*value_node->find(old_time); + waypoint=*value_node_animated->find(old_time); waypoint.set_time(new_time); } catch(...) { waypoint.set_time(new_time); - waypoint.set_value((*value_node)(old_time)); + waypoint.set_value((*value_node_animated)(old_time)); } action->set_param("waypoint",waypoint); diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index a669d1b..e89fff7 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -748,13 +748,13 @@ _process_value_desc(const synfigapp::ValueDesc& value_desc,std::vectorlink_count();i++) + for(i=0;ilink_count();i++) { - ValueNode::Handle link(value_node->get_link(i)); + ValueNode::Handle link(value_node_copy->get_link(i)); if(!link->is_exported()) - ret+=_process_value_desc(ValueDesc(value_node,i),out,guid_set); + ret+=_process_value_desc(ValueDesc(value_node_copy,i),out,guid_set); } } else if(ValueNode_Animated::Handle::cast_dynamic(value_node)) -- 2.7.4