On Tue, Mar 26, 2002 at 05:31:52PM +0100, Herbert Voss wrote:
> Angus Leeming wrote:
> 
> >On Tuesday 26 March 2002 4:11 pm, Kayvan A. Sylvan wrote:
> >
> >>On Tue, Mar 26, 2002 at 09:20:53AM +0100, Herbert Voss wrote:
> >>
> >>>Kayvan A. Sylvan wrote:
> >>>
> >>>>Latest CVS, a document that was loading just fine as of a few days
> >>>>ago... Now I can no longer ``View Postscript''.
> >>>>
> >>I found the problem. A recent change makes LyX output the absolute path
> >>to the graphics file (instead of a relative path).
> >>
> >
> >It will only output the absolute path if the file is stored as an absolute 
> >path. If you store it as relative to your doc, then it'll output the 
> >relative path. That has to conform to the principle of least surprise.
> 
> 
> these are the lines from latex():
> 
> string const latex_str = before + '{' + prepareFile(buf) + '}' + after;
> os << latex_str;
> 
> and prepareFile() makes it as an absolute path:
> 
> string filename_  = MakeAbsPath(params().filename, buf->filePath());
> bool const zipped = zippedFile(filename_);
> [...]

Here's the patch.

-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
Index: src/insets/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.366
diff -u -r1.366 ChangeLog
--- src/insets/ChangeLog        2002/03/26 15:21:58     1.366
+++ src/insets/ChangeLog        2002/03/26 16:49:47
@@ -1,3 +1,7 @@
+2002-03-26  Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+       * insetgraphics.C (prepareFile): fix external path for Cygwin.
+
 2002-03-26  Angus Leeming  <[EMAIL PROTECTED]>
 
        * insetgraphicsParams.C (Read): revert Herbert's fix and apply the
Index: src/insets/insetgraphics.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.96
diff -u -r1.96 insetgraphics.C
--- src/insets/insetgraphics.C  2002/03/26 15:21:58     1.96
+++ src/insets/insetgraphics.C  2002/03/26 16:49:47
@@ -99,6 +99,7 @@
 #include "support/LAssert.h"
 #include "support/filetools.h"
 #include "support/lyxalgo.h" // lyx::count
+#include "support/os.h"
 
 #include <algorithm> // For the std::max
 
@@ -610,6 +611,7 @@
        //
        // if it's a zipped one, than let LaTeX do the rest!!!
        string filename_  = MakeAbsPath(params().filename, buf->filePath());
+       filename_ = os::external_path(filename_);
        bool const zipped = zippedFile(filename_);
 
        if ((zipped && params().noUnzip) || buf->niceFile) {

Attachment: msg35468/pgp00000.pgp
Description: PGP signature

Reply via email to