From ab53dc5d7bf0bcc6e91bb5629c3090294d38a486 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 25 Mar 2002 16:15:46 +0000 Subject: [PATCH] Herbert's patch to stop LyX from hanging if the graphics file does not exist. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3826 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 5 +++++ src/insets/insetgraphicsParams.C | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index ef7a08ebd5..7cbf3cfad2 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-03-25 Herbert Voss + + * insetgraphicsParams.C (Read): prevent LyX from hanging if the + graphics file does not exist. + 2002-03-25 Angus Leeming * insetgraphics.C (prepareFile): ensure that the file has an absolute diff --git a/src/insets/insetgraphicsParams.C b/src/insets/insetgraphicsParams.C index e4e77d960c..b1bfec7975 100644 --- a/src/insets/insetgraphicsParams.C +++ b/src/insets/insetgraphicsParams.C @@ -251,8 +251,11 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const& token) draft = true; } else if (token == "display") { lex.next(); - string const type = lex.getString(); - display = displayTranslator.find(type); + if (IsFileReadable(filename)) { + string const type = lex.getString(); + display = displayTranslator.find(type); + } else + display = NONE; } else if (token == "subcaption") { subcaption = true; } else if (token == "subcaptionText") { -- 2.39.2