]> git.lyx.org Git - features.git/commitdiff
Are we iterating to a converged solution? Assuming that this works on
authorAngus Leeming <leeming@lyx.org>
Tue, 26 Mar 2002 18:08:07 +0000 (18:08 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 26 Mar 2002 18:08:07 +0000 (18:08 +0000)
cygwin, then yes.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3844 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetgraphics.C

index 1c1b35568f6f5947a05774ae287a3c409a1329d0..f10e3d7c8ae02edb7073b0931a57f36ad4a7245e 100644 (file)
@@ -1,7 +1,8 @@
 2002-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * insetgraphicsParams.C (latexify): use \textbackslash in preference to
-       $\backslash$.
+       $\backslash$ and pass a "string const &" to the function.
+       (prepareFile, latex): use Path rather than MakeAbsPath.
 
 2002-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
 
index 714a15f0d7a4a82433ecc38e4ff207cd069c2a54..87dbd920d89176a95c0fb90f200c601a689a8e38 100644 (file)
@@ -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,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
        //   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_  = params().filename;
        bool const zipped = zippedFile(filename_);
 
        if ((zipped && params().noUnzip) || buf->niceFile) {
@@ -618,6 +619,10 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
                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_);
 
@@ -644,7 +649,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
 
 namespace {
 
-string const latexify(string const str)
+string const latexify(string const str)
 {
        ostringstream out;
 
@@ -695,8 +700,13 @@ int InsetGraphics::latex(Buffer const *buf, ostream & os,
                        << _("empty figure path") << "}\n";
                return 1; // One end-of-line marker added to the stream.
        }
+
+       // Enable these helper functions to find the file if it is stored as
+       // a relative path.
+       Path p(buf->filePath());
+
        // Ditto if the file is not there.
-       if (!IsFileReadable(MakeAbsPath(params().filename, buf->filePath()))) {
+       if (!IsFileReadable(params().filename)) {
                os  << "\\fbox{\\rule[-0.5in]{0pt}{1in}"
                    << latexify(MakeRelPath(params().filename, buf->filePath()))
                    << _(" not found") << "}\n";
@@ -728,8 +738,6 @@ int InsetGraphics::latex(Buffer const *buf, ostream & os,
        int const newlines =
                int(lyx::count(latex_str.begin(), latex_str.end(),'\n') + 1);
 
-       // lyxerr << "includegraphics: " << newlines << " lines of text"
-       //        << endl;
        return newlines;
 }