mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Exclude stdinsets.inc from basic layout if we exclude stdclass.inc
If loading a basic layout fails, we try to load a basic layout without stdclass.inc instead. However, this still 'implicitly' requires stdinsets.inc. If the load failed because stdclass.inc couldn't be loaded, we expect that stdinsets.inc can't be loaded as well, so we should exclude stdinsets.inc as well. This prevents an assertion if stdinsets.inc can't be found or can't be loaded. This can happen when the layouts have the wrong format and python is not available.
This commit is contained in:
parent
5e4e4b674c
commit
af5ecd1c8d
@ -232,11 +232,12 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
|
||||
if (!tc->load(tempLayout.absFileName())) {
|
||||
// The only way this happens is because the hardcoded layout file
|
||||
// above is wrong or stdclass.inc cannot be found. So try again
|
||||
// without stdclass.inc.
|
||||
// without stdclass.inc and without stdinsets.inc.
|
||||
ofstream ofs2(tempLayout.toFilesystemEncoding().c_str());
|
||||
ofs2 << "# This layout is automatically generated\n"
|
||||
"# \\DeclareLaTeXClass{" << textclass << "}\n\n"
|
||||
"Format " << LAYOUT_FORMAT << "\n"
|
||||
"Provides stdinsets 1\n"
|
||||
<< layoutpost;
|
||||
ofs2.close();
|
||||
if (!tc->load(tempLayout.absFileName())) {
|
||||
|
Loading…
Reference in New Issue
Block a user