mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Consider required modules when checking for layout definitions in modules
Fixes: #11156.
This commit is contained in:
parent
a3868e40a4
commit
8b4c76fb24
@ -386,16 +386,28 @@ bool checkModule(string const & name, bool command)
|
|||||||
add = true;
|
add = true;
|
||||||
}
|
}
|
||||||
if (add) {
|
if (add) {
|
||||||
FileName layout_file = libFileSearch("layouts", module, "module");
|
vector<string> v;
|
||||||
|
LayoutModuleList mods;
|
||||||
|
// addModule is necessary in order to catch required modules
|
||||||
|
// as well (see #11156)
|
||||||
|
if (!addModule(module, baseClass, mods, v))
|
||||||
|
return false;
|
||||||
|
for (auto const & mod : mods) {
|
||||||
|
if (!used_modules.moduleCanBeAdded(mod, &baseClass))
|
||||||
|
return false;
|
||||||
|
FileName layout_file = libFileSearch("layouts", mod, "module");
|
||||||
if (textclass.read(layout_file, TextClass::MODULE)) {
|
if (textclass.read(layout_file, TextClass::MODULE)) {
|
||||||
used_modules.push_back(module);
|
used_modules.push_back(mod);
|
||||||
// speed up further searches:
|
// speed up further searches:
|
||||||
// the module does not need to be checked anymore.
|
// the module does not need to be checked anymore.
|
||||||
|
ModuleMap::iterator const it = modules.find(mod);
|
||||||
|
if (it != modules.end())
|
||||||
modules.erase(it);
|
modules.erase(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
failed[command].insert(name);
|
failed[command].insert(name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user