mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 00:20:43 +00:00
If there exists a local layout file, use the local copy instead of the system one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21800 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
de8ce17784
commit
3f30fe7421
@ -469,20 +469,24 @@ string const BufferParams::readToken(Lexer & lex, string const & token)
|
|||||||
if (token == "\\textclass") {
|
if (token == "\\textclass") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const classname = lex.getString();
|
string const classname = lex.getString();
|
||||||
pair<bool, lyx::textclass_type> pp =
|
// if there exists a local layout file, ignore the system one
|
||||||
textclasslist.numberOfClass(classname);
|
// NOTE: in this case, the textclass (.cls file) is assumed to be available.
|
||||||
if (pp.first) {
|
pair<bool, lyx::textclass_type> pp = textclasslist.addTextClass(classname, filepath);
|
||||||
|
if (pp.first)
|
||||||
setBaseClass(pp.second);
|
setBaseClass(pp.second);
|
||||||
} else {
|
else {
|
||||||
// if text class does not exist, try to load it from filepath
|
pp = textclasslist.numberOfClass(classname);
|
||||||
pp = textclasslist.addTextClass(classname, filepath);
|
if (pp.first)
|
||||||
if (pp.first) {
|
|
||||||
setBaseClass(pp.second);
|
setBaseClass(pp.second);
|
||||||
} else {
|
else {
|
||||||
|
// a warning will be given for unknown class
|
||||||
setBaseClass(defaultTextclass());
|
setBaseClass(defaultTextclass());
|
||||||
return classname;
|
return classname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// FIXME: this warning will be given even if there exists a local .cls
|
||||||
|
// file. Even worse, the .lyx file can not be compiled or exported
|
||||||
|
// because the textclass is marked as unavilable.
|
||||||
if (!getTextClass().isTeXClassAvailable()) {
|
if (!getTextClass().isTeXClassAvailable()) {
|
||||||
docstring const msg =
|
docstring const msg =
|
||||||
bformat(_("The layout file requested by this document,\n"
|
bformat(_("The layout file requested by this document,\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user