On Tuesday 26 March 2002 5:05 pm, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> Shouldn't that be wrapped inside MakeAbsPath? Shall I do that?
>
> Please do not do that. I think the calls to os::external_path should
> be done only at the point when you plan to handover the path to an
> external program. In this case, you need to do that when you output
> the lyx file. I think the right place is in the output to stream.
>
> JMarc

Fair enough.

Kayvan, this patch works for me. Does it work for you?

Angus
Index: src/insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.97
diff -u -p -r1.97 insetgraphics.C
--- src/insets/insetgraphics.C	26 Mar 2002 16:10:49 -0000	1.97
+++ src/insets/insetgraphics.C	26 Mar 2002 17:04:11 -0000
@@ -99,6 +99,7 @@ TODO Before initial production release:
 #include "support/LAssert.h"
 #include "support/filetools.h"
 #include "support/lyxalgo.h" // lyx::count
+#include "support/path.h"
 
 #include <algorithm> // For the std::max
 
@@ -609,7 +610,8 @@ string const InsetGraphics::prepareFile(
 	//   return original filename without the extension
 	//
 	// if it's a zipped one, than let LaTeX do the rest!!!
-	string filename_  = MakeAbsPath(params().filename, buf->filePath());
+//  	string filename_  = MakeAbsPath(params().filename, buf->filePath());
+	string filename_  = params().filename;
 	bool const zipped = zippedFile(filename_);
 
 	if ((zipped && params().noUnzip) || buf->niceFile) {
@@ -618,6 +620,10 @@ string const InsetGraphics::prepareFile(
 		return filename_;
 	}
 
+	// Enable these helper functions to find the file if it is stored as
+	// a relative path.
+	Path p(buf->filePath());
+
 	if (zipped)
 		filename_ = unzipFile(filename_);
 

Reply via email to