Couple of new functions to duplicate and delete a waypoint without having a ValueDesc.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 4 Feb 2008 23:35:11 +0000 (23:35 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 4 Feb 2008 23:35:11 +0000 (23:35 +0000)
git-svn-id: http://svn.voria.com/code@1582 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/canvasinterface.cpp

index 29a52b1..15e6efc 100644 (file)
@@ -612,6 +612,13 @@ CanvasInterface::import(const synfig::String &filename, bool /*copy*/)
 void
 CanvasInterface::waypoint_duplicate(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint)
 {
+       ValueNode::Handle value_node();
+       waypoint_duplicate(value_desc.get_value_node(), waypoint);
+}
+
+void
+CanvasInterface::waypoint_duplicate(ValueNode::Handle value_node,synfig::Waypoint waypoint)
+{
        Action::Handle  action(Action::create("waypoint_set_smart"));
 
        assert(action);
@@ -621,8 +628,6 @@ CanvasInterface::waypoint_duplicate(synfigapp::ValueDesc value_desc,synfig::Wayp
        waypoint.make_unique();
        waypoint.set_time(get_time());
 
-       ValueNode::Handle value_node(value_desc.get_value_node());
-
        action->set_param("canvas",get_canvas());
        action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
        action->set_param("waypoint",waypoint);
@@ -636,14 +641,19 @@ CanvasInterface::waypoint_duplicate(synfigapp::ValueDesc value_desc,synfig::Wayp
 void
 CanvasInterface::waypoint_remove(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint)
 {
+       ValueNode::Handle value_node();
+       waypoint_remove(value_desc.get_value_node(), waypoint);
+}
+
+void
+CanvasInterface::waypoint_remove(ValueNode::Handle value_node,synfig::Waypoint waypoint)
+{
        Action::Handle  action(Action::create("waypoint_remove"));
 
        assert(action);
        if(!action)
                return;
 
-       ValueNode::Handle value_node(value_desc.get_value_node());
-
        action->set_param("canvas",get_canvas());
        action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
        action->set_param("waypoint",waypoint);