diff --git a/synfig-core/src/loadcanvas.rs b/synfig-core/src/loadcanvas.rs index 26c2593..149ef07 100644 --- a/synfig-core/src/loadcanvas.rs +++ b/synfig-core/src/loadcanvas.rs @@ -26,35 +26,35 @@ pub fn open_canvas(node: &xmlpp::Element, errors: String, warnings: String) -> B // Loads a canvas from a filename and its absolute path // returns the Canvas's handle on success, an None on failure -// pub fn open_canvas_as( -// identifier: filesystem::Identifier, -// as_: String, -// errors: String, -// warnings: String, -// ) -> Option> { -// let filename = filesystem::fix_slashes(as_); - -// //if CanvasParser::loading.contains(&identifier) -// if identifier.filename.is_empty() -// { -// let warning = format!("cannot load '{}' recursively", identifier.filename.as_str()); -// warn!("{}", warning); -// let warnings = format!(" * {}\n", warning); -// let mut canvas = Canvas::create(); -// canvas.set_identifier(identifier); -// canvas.set_file_name(filename); -// // Layer::Handle paste(Layer_Group::create()); -// // canvas->push_back(paste); -// // paste->set_description(warning); -// return Some(canvas); -// } - -// let mut canvas: Box; -// //let mut parser = CanvasParser::new(); - -// // Some(canvas) -// None -// } +pub fn open_canvas_as( + identifier: filesystem::Identifier, + as_: String, + errors: String, + warnings: String, +) -> Option> { + let filename = filesystem::fix_slashes(as_); + + //if CanvasParser::loading.contains(&identifier) + if identifier.filename.is_empty() + { + let warning = format!("cannot load '{}' recursively", identifier.filename.as_str()); + warn!("{}", warning); + let warnings = format!(" * {}\n", warning); + let mut canvas = Canvas::create(); + canvas.set_identifier(identifier); + canvas.set_file_name(filename); + // Layer::Handle paste(Layer_Group::create()); + // canvas->push_back(paste); + // paste->set_description(warning); + return Some(canvas); + } + + let mut canvas: Box; + //let mut parser = CanvasParser::new(); + + // Some(canvas) + None +} // Returns the Open Canvases Map. type OpenCanvasMap = HashMap;