]> git.lyx.org Git - features.git/commitdiff
* Revert Herbert's patch of yesterday to deal with non-existent
authorAngus Leeming <leeming@lyx.org>
Tue, 26 Mar 2002 12:17:04 +0000 (12:17 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 26 Mar 2002 12:17:04 +0000 (12:17 +0000)
  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

src/insets/ChangeLog
src/insets/insetgraphics.C
src/insets/insetgraphicsParams.C

index ad2df8cd1df60132b9c52b56ddc45ac7d02a4732..9de84bde84db89d729f178573769a320587e8723 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * 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  <jug@sad.it>
 
        * insettext.C (setText): added a LyXFont param and call reinitLyXText()
index f5f86b8f37f8a6b478968123044bd1dc5c66a7a3..b7e93ddb5b438fe29ff3b8a1aa362003fb950d74 100644 (file)
@@ -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.
index b1bfec7975eab4eb4c459123371b5c559aaed37c..e4e77d960c3795040c5dc539fae71156b0612130 100644 (file)
@@ -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") {