From 6c15c36495bfcb7a862427cf01ed5770ce2cb6c6 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 10 Jul 2007 15:07:00 +0000 Subject: [PATCH] This patch revert part of the code changed in revision 18825. This is needed because there is no lyx_view_ when exporting at the command-line: LFUN_BUFFER_CHILD_OPEN uses LyXView::loadLyXFile() in GUI mode. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19029 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetInclude.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 169c8baff8..90f776e215 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -404,9 +404,19 @@ bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params) // the readonly flag can/will be wrong, not anymore I think. if (!fs::exists(included_file.toFilesystemEncoding())) return false; - lyx::dispatch(FuncRequest(LFUN_BUFFER_CHILD_OPEN, - included_file.absFilename() + "|true")); - buf = theBufferList().getBuffer(included_file.absFilename()); + if (use_gui) { + lyx::dispatch(FuncRequest(LFUN_BUFFER_CHILD_OPEN, + included_file.absFilename() + "|true")); + buf = theBufferList().getBuffer(included_file.absFilename()); + } + else { + buf = theBufferList().newBuffer(included_file.absFilename()); + if (!loadLyXFile(buf, included_file)) { + //close the buffer we just opened + theBufferList().close(buf, false); + return false; + } + } return buf; } buf->setParentName(parentFilename(buffer)); -- 2.39.2