File lyx-1.5.0rc2-bug248282.patch of Package lyx
Index: /lyx-devel/trunk/src/insets/InsetInclude.cpp
===================================================================
--- /lyx-devel/trunk/src/insets/InsetInclude.cpp (revision 18897)
+++ /lyx-devel/trunk/src/insets/InsetInclude.cpp (revision 19029)
@@ -405,7 +405,17 @@
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;
}