From: Angus Leeming Date: Tue, 26 Mar 2002 18:08:07 +0000 (+0000) Subject: Are we iterating to a converged solution? Assuming that this works on X-Git-Tag: 1.6.10~19557 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=04e819e4fdfb35798b2268a38d0f996e281b0217;p=features.git Are we iterating to a converged solution? Assuming that this works on cygwin, then yes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3844 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 1c1b35568f..f10e3d7c8a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,7 +1,8 @@ 2002-03-26 Angus Leeming * 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 diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 714a15f0d7..87dbd920d8 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -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 // 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; }