From: Angus Leeming Date: Tue, 26 Mar 2002 12:17:04 +0000 (+0000) Subject: * Revert Herbert's patch of yesterday to deal with non-existent X-Git-Tag: 1.6.10~19564 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=07386186b00d31cadf5e4707d7af3e195ad79ee7;p=features.git * Revert Herbert's patch of yesterday to deal with non-existent graphics files; it isn't needed anymore. * Produce "pretty" latex output if the graphics file isn't found. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3837 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index ad2df8cd1d..9de84bde84 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,9 @@ +2002-03-26 Angus Leeming + + * insetgraphicsParams.C (Read): revert Herbert's fix and apply the + proper fix to the graphics cache. + (latex): nice output if the file is not found. + 2002-03-26 Juergen Vigna * insettext.C (setText): added a LyXFont param and call reinitLyXText() diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index f5f86b8f37..b7e93ddb5b 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -650,7 +650,13 @@ int InsetGraphics::latex(Buffer const *buf, ostream & os, if (params().filename.empty()) { os << "\\fbox{\\rule[-0.5in]{0pt}{1in}" << _("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. + } + // Ditto if the file is not there. + if (!IsFileReadable(MakeAbsPath(params().filename, buf->filePath()))) { + os << "\\fbox{\\rule[-0.5in]{0pt}{1in}" + << _("file not found") << "}\n"; + return 1; // One end-of-line marker added to the stream. } // These variables collect all the latex code that should be before and // after the actual includegraphics command. diff --git a/src/insets/insetgraphicsParams.C b/src/insets/insetgraphicsParams.C index b1bfec7975..e4e77d960c 100644 --- a/src/insets/insetgraphicsParams.C +++ b/src/insets/insetgraphicsParams.C @@ -251,11 +251,8 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const& token) draft = true; } else if (token == "display") { lex.next(); - if (IsFileReadable(filename)) { - string const type = lex.getString(); - display = displayTranslator.find(type); - } else - display = NONE; + string const type = lex.getString(); + display = displayTranslator.find(type); } else if (token == "subcaption") { subcaption = true; } else if (token == "subcaptionText") {