Fix 2435346: "Export canvas, save and revert keeps the inline canvas". Use LayerPara...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 17 Dec 2008 21:06:24 +0000 (21:06 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 17 Dec 2008 21:06:24 +0000 (21:06 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2312 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp

index 622e977..da13f65 100644 (file)
@@ -35,6 +35,7 @@
 #include "canvasadd.h"
 #include "valuedescexport.h"
 #include "layerparamconnect.h"
+#include "layerparamset.h"
 
 #include <synfigapp/canvasinterface.h>
 #include <synfig/valuenode_const.h>
@@ -180,29 +181,16 @@ Action::ValueDescExport::prepare()
 
                add_action_front(action);
 
-               if(value_desc.is_value_node())
+               if(value_desc.parent_is_layer_param() && !value_desc.is_value_node())
                {
-                       assert(0);                      // we shouldn't get here I don't think
-                       if(value_desc.get_value_node()->is_exported())
-                               throw Error(_("ValueBase is already exported"));
-
-                       value_node=value_desc.get_value_node();
-               }
-               else
-               {
-                       // action: LayerParamConnect
-                       if(!value_desc.parent_is_layer_param())
-                               throw Error(_("Unable to export parameter. (Bug?)"));
-
-                       value_node=ValueNode_Const::create(canvas);
-
-                       Action::Handle action(LayerParamConnect::create());
+                       // action: LayerParamSet
+                       Action::Handle action(LayerParamSet::create());
 
                        action->set_param("canvas",get_canvas());
                        action->set_param("canvas_interface",get_canvas_interface());
                        action->set_param("layer",value_desc.get_layer());
                        action->set_param("param",value_desc.get_param_name());
-                       action->set_param("value_node",value_node);
+                       action->set_param("new_value",ValueBase(canvas));
 
                        assert(action->is_ready());
                        if(!action->is_ready())