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:
Vincent van Ravesteijn 2012-05-03 12:02:34 +02:00
parent 5e4e4b674c
commit af5ecd1c8d

View File

@ -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())) {