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
This commit is contained in:
Angus Leeming 2002-03-26 18:08:07 +00:00
parent ff7eec0cbe
commit 04e819e4fd
2 changed files with 15 additions and 6 deletions

View File

@ -1,7 +1,8 @@
2002-03-26 Angus Leeming <a.leeming@ic.ac.uk> 2002-03-26 Angus Leeming <a.leeming@ic.ac.uk>
* insetgraphicsParams.C (latexify): use \textbackslash in preference to * 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> 2002-03-26 Angus Leeming <a.leeming@ic.ac.uk>

View File

@ -99,6 +99,7 @@ TODO Before initial production release:
#include "support/LAssert.h" #include "support/LAssert.h"
#include "support/filetools.h" #include "support/filetools.h"
#include "support/lyxalgo.h" // lyx::count #include "support/lyxalgo.h" // lyx::count
#include "support/path.h"
#include <algorithm> // For the std::max #include <algorithm> // For the std::max
@ -609,7 +610,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
// return original filename without the extension // return original filename without the extension
// //
// if it's a zipped one, than let LaTeX do the rest!!! // 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_); bool const zipped = zippedFile(filename_);
if ((zipped && params().noUnzip) || buf->niceFile) { if ((zipped && params().noUnzip) || buf->niceFile) {
@ -618,6 +619,10 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
return filename_; return filename_;
} }
// Enable these helper functions to find the file if it is stored as
// a relative path.
Path p(buf->filePath());
if (zipped) if (zipped)
filename_ = unzipFile(filename_); filename_ = unzipFile(filename_);
@ -644,7 +649,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
namespace { namespace {
string const latexify(string const str) string const latexify(string const & str)
{ {
ostringstream out; ostringstream out;
@ -695,8 +700,13 @@ int InsetGraphics::latex(Buffer const *buf, ostream & os,
<< _("empty figure path") << "}\n"; << _("empty figure path") << "}\n";
return 1; // One end-of-line marker added to the stream. 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. // 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}" os << "\\fbox{\\rule[-0.5in]{0pt}{1in}"
<< latexify(MakeRelPath(params().filename, buf->filePath())) << latexify(MakeRelPath(params().filename, buf->filePath()))
<< _(" not found") << "}\n"; << _(" not found") << "}\n";
@ -728,8 +738,6 @@ int InsetGraphics::latex(Buffer const *buf, ostream & os,
int const newlines = int const newlines =
int(lyx::count(latex_str.begin(), latex_str.end(),'\n') + 1); int(lyx::count(latex_str.begin(), latex_str.end(),'\n') + 1);
// lyxerr << "includegraphics: " << newlines << " lines of text"
// << endl;
return newlines; return newlines;
} }