diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 9d2678694b..ea72d6c3cd 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -493,24 +493,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt) break; } -#ifdef TEX2LYX - case TC_DEFAULTMODULE: // Include file - if (lexrc.next()) { - string const inc = lexrc.getString(); - FileName tmp = libFileSearch("layouts", inc, - "module"); - - if (tmp.empty()) { - lexrc.printError("Could not find module: " + inc); - error = true; - } else if (!read(tmp, MERGE)) { - lexrc.printError("Error reading module" - "file: " + tmp.absFilename()); - error = true; - } - } - break; -#else case TC_DEFAULTMODULE: { lexrc.next(); string const module = lexrc.getString(); @@ -518,7 +500,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt) default_modules_.push_back(module); break; } -#endif case TC_PROVIDESMODULE: { lexrc.next(); @@ -633,6 +614,22 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt) if (rt != BASECLASS) return (error ? ERROR : OK); +#ifdef TEX2LYX + list::const_iterator it = default_modules_.begin(); + list::const_iterator const endit = default_modules_.end(); + for ( ; it != endit ; ++it) { + FileName tmp = libFileSearch("layouts", *it, "module"); + if (tmp.empty()) { + lexrc.printError("Could not find module: " + *it); + error = true; + } else if (!read(tmp, MERGE)) { + lexrc.printError("Error reading module" + "file: " + tmp.absFilename()); + error = true; + } + } +#endif + if (defaultlayout_.empty()) { LYXERR0("Error: Textclass '" << name_ << "' is missing a defaultstyle.");