From 629689cd7ff036c1ac53b6b9bf4fc2c8ac40d6c3 Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 25 Nov 2008 01:22:35 +0000 Subject: [PATCH] Always use absolute paths in the Canvas::externals_ map. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2269 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/canvas.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/synfig-core/trunk/src/synfig/canvas.cpp b/synfig-core/trunk/src/synfig/canvas.cpp index 30697ef..2bbb743 100644 --- a/synfig-core/trunk/src/synfig/canvas.cpp +++ b/synfig-core/trunk/src/synfig/canvas.cpp @@ -537,17 +537,16 @@ Canvas::surefind_canvas(const String &id, String &warnings) Canvas::Handle external_canvas; + if(!is_absolute_path(file_name)) + file_name = get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name; + // If the composition is already open, then use it. if(externals_.count(file_name)) external_canvas=externals_[file_name]; else { String errors; - if(is_absolute_path(file_name)) - external_canvas=open_canvas(file_name, errors, warnings); - else - external_canvas=open_canvas(get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name, errors, warnings); - + external_canvas=open_canvas(file_name, errors, warnings); if(!external_canvas) throw runtime_error(errors); externals_[file_name]=external_canvas; @@ -624,17 +623,16 @@ Canvas::find_canvas(const String &id, String &warnings)const Canvas::Handle external_canvas; + if(!is_absolute_path(file_name)) + file_name = get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name; + // If the composition is already open, then use it. if(externals_.count(file_name)) external_canvas=externals_[file_name]; else { String errors, warnings; - if(is_absolute_path(file_name)) - external_canvas=open_canvas(file_name, errors, warnings); - else - external_canvas=open_canvas(get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name, errors, warnings); - + external_canvas=open_canvas(file_name, errors, warnings); if(!external_canvas) throw runtime_error(errors); externals_[file_name]=external_canvas; -- 2.7.4