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
This commit is contained in:
Abdelrazak Younes 2007-07-10 15:07:00 +00:00
parent c4769a4d4c
commit 6c15c36495

View File

@ -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));