Do not output parameters twice if the file was not found (part of bug #6127).

In this case, the inset parameters win in case there is any conflict. The only
exception is "type=eps", since I was too lazy to make the full keyval parser
of tex2lyx available to InsetGraphics in order to parse the special parameter.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40298 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-11-27 20:12:32 +00:00
parent 0ac0f56ebc
commit 4925de1097
2 changed files with 16 additions and 4 deletions

View File

@ -333,6 +333,8 @@ bool Converters::convert(Buffer const * buffer,
// This has the added benefit that all other files that may be
// generated by the converter are deleted when LyX closes and do not
// clutter the real working directory.
// FIXME: This does not work if path is an UNC path on windows
// (bug 6127).
string const path(onlyPath(from_file.absFileName()));
// Prevent the compiler from optimizing away p
FileName pp(path);

View File

@ -755,10 +755,20 @@ void InsetGraphics::latex(otexstream & os,
bool const file_exists = !params().filename.empty()
&& params().filename.isReadableFile();
string const message = file_exists ?
string() : string("bb = 0 0 200 100, draft, type=eps");
// if !message.empty() then there was no existing file
// "filename" found. In this case LaTeX
string message;
if (!file_exists) {
if (params().bb.empty())
message = "bb = 0 0 200 100";
if (!params().draft) {
if (!message.empty())
message += ", ";
message += "draft";
}
if (!message.empty())
message += ", ";
message += "type=eps";
}
// If no existing file "filename" was found LaTeX
// draws only a rectangle with the above bb and the
// not found filename in it.
LYXERR(Debug::GRAPHICS, "\tMessage = \"" << message << '\"');