Fix 2315706: "Rename Exported Valuenode from imported canvases crash". Stop the...
[synfig.git] / synfig-studio / trunk / src / synfigapp / canvasinterface.cpp
index ca4c651..da1a802 100644 (file)
@@ -560,7 +560,7 @@ CanvasInterface::jump_to_prev_keyframe()
 }
 
 bool
-CanvasInterface::import(const synfig::String &filename, bool resize_image)
+CanvasInterface::import(const synfig::String &filename, synfig::String &errors, synfig::String &warnings, bool resize_image)
 {
        Action::PassiveGrouper group(get_instance().get(),_("Import Image"));
 
@@ -579,8 +579,7 @@ CanvasInterface::import(const synfig::String &filename, bool resize_image)
        // If this is a SIF file, then we need to do things slightly differently
        if(ext=="sif" || ext=="sifz")try
        {
-               String errors;
-               Canvas::Handle outside_canvas(synfig::open_canvas(filename, errors));
+               Canvas::Handle outside_canvas(synfig::open_canvas(filename, errors, warnings));
                if(!outside_canvas)
                        throw String(_("Unable to open this composition")) + ":\n\n" + errors;
 
@@ -589,6 +588,7 @@ CanvasInterface::import(const synfig::String &filename, bool resize_image)
                        throw String(_("Unable to create \"Paste Canvas\" layer"));
                if(!layer->set_param("canvas",ValueBase(outside_canvas)))
                        throw int();
+               get_canvas()->register_external_canvas(filename, outside_canvas);
 
                //layer->set_description(basename(filename));
                signal_layer_new_description()(layer,filename);