From 5614c0459a1570b21398108423f6d22336e69f5f Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Sun, 13 Jan 2002 23:00:15 +0000 Subject: [PATCH] fix assert with broken symlinks on buffer-open; fix bug #104 crash with --export with new graphics inset git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3362 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/FormFiledialog.C | 11 +++++++++-- src/insets/ChangeLog | 3 +++ src/insets/insetgraphics.C | 6 +++--- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 4a87551740..68e23615d6 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2002-01-13 Jean-Marc Lasgouttes + + * FormFiledialog.C (Reread): skip broken symlinks + 2002-01-13 Lars Gullik Bjønnes * FormMathsMatrix.C (AlignFilter): use std::count and add some diff --git a/src/frontends/xforms/FormFiledialog.C b/src/frontends/xforms/FormFiledialog.C index 0b4037da38..95a4701b88 100644 --- a/src/frontends/xforms/FormFiledialog.C +++ b/src/frontends/xforms/FormFiledialog.C @@ -277,8 +277,12 @@ void FileDialog::Private::Reread() // gets file status File = AddName(pszDirectory, fname); - // FIXME: we don't get this file exists/stattable FileInfo fileInfo(File, true); + + // can this really happen? + if (!fileInfo.isOK()) + continue; + fileInfo.modeString(szMode); unsigned int nlink = fileInfo.getNumberOfLinks(); string user = lyxUserCache.find(fileInfo.getUid()); @@ -323,7 +327,10 @@ void FileDialog::Private::Reread() // link). Is that intended? // JV 199902 fileInfo.newFile(File); - Buffer += fileInfo.typeIndicator(); + if (fileInfo.isOK()) + Buffer += fileInfo.typeIndicator(); + else + continue; } } diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index f5300b8cd3..004725dce1 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,5 +1,8 @@ 2002-01-13 Jean-Marc Lasgouttes + * insetgraphics.C (updateInset): do not try to render image if + lyxrc.use_gui is false (bug #104) + * insetinclude.C (loadIfNeeded): do not call bufferlist.readFile if file does not exist diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index b4f7f7cd5e..9b081b1fa3 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -798,9 +798,9 @@ void InsetGraphics::updateInset() const // We do it this way so that in the face of some error, we will still // be in a valid state. - if (!params.filename.empty() && - lyxrc.display_graphics != "no" && - params.display != InsetGraphicsParams::NONE) { + if (!params.filename.empty() && lyxrc.use_gui + && lyxrc.display_graphics != "no" + && params.display != InsetGraphicsParams::NONE) { temp = gc.addFile(params.filename); } -- 2.39.2