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>
#include "support/LAssert.h"
#include "support/filetools.h"
#include "support/lyxalgo.h" // lyx::count
+#include "support/path.h"
#include <algorithm> // For the std::max
// 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) {
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_);
namespace {
-string const latexify(string const str)
+string const latexify(string const & str)
{
ostringstream out;
<< _("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";
int const newlines =
int(lyx::count(latex_str.begin(), latex_str.end(),'\n') + 1);
- // lyxerr << "includegraphics: " << newlines << " lines of text"
- // << endl;
return newlines;
}