: pimpl_(new Impl)
{
setBaseClass(defaultTextclass());
+ makeTextClass();
paragraph_separation = PARSEP_INDENT;
quotes_language = InsetQuotes::EnglishQ;
fontsize = "default";
readPreamble(lex);
} else if (token == "\\begin_modules") {
readModules(lex);
- makeTextClass();
} else if (token == "\\options") {
lex.eatLine();
options = lex.getString();
void BufferParams::validate(LaTeXFeatures & features) const
{
+ if (!getTextClass().requires().empty()) {
+ vector<string> req = getTextClass().requires();
+ for (vector<string>::const_iterator it = req.begin();
+ it != req.end(); ++it) {
+ features.require(*it);
+ }
+ }
+
if (outputChanges) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
bool BufferParams::setBaseClass(textclass_type tc)
{
- bool retVal = true;
- if (textclasslist[tc].load())
+ if (textclasslist[tc].load()) {
baseClass_ = tc;
- else {
- docstring s =
- bformat(_("The document class %1$s could not be loaded."),
- from_utf8(textclasslist[tc].name()));
- frontend::Alert::error(_("Could not load class"), s);
- retVal = false;
+ return true;
}
- makeTextClass();
- return retVal;
-}
-
-
-void BufferParams::setJustBaseClass(textclass_type tc)
-{
- baseClass_ = tc;
+
+ docstring s =
+ bformat(_("The document class %1$s could not be loaded."),
+ from_utf8(textclasslist[tc].name()));
+ frontend::Alert::error(_("Could not load class"), s);
+ return false;
}
void BufferParams::makeTextClass()
{
textClass_.reset(new TextClass(textclasslist[getBaseClass()]));
+
//FIXME It might be worth loading the children's modules here,
//just as we load their bibliographies and such, instead of just
//doing a check in InsetInclude.
"may not be possible.\n"), from_utf8(modName));
frontend::Alert::warning(_("Package not available"), msg);
}
- FileName layout_file = libFileSearch("layouts", lm->filename);
+ FileName layout_file = libFileSearch("layouts", lm->getFilename());
textClass_->read(layout_file, TextClass::MODULE);
}
}
-bool BufferParams::addLayoutModule(string modName, bool makeClass) {
+bool BufferParams::addLayoutModule(string const & modName) {
LayoutModuleList::const_iterator it = layoutModules_.begin();
LayoutModuleList::const_iterator end = layoutModules_.end();
for (; it != end; it++) {
if (it != layoutModules_.end())
return false;
layoutModules_.push_back(modName);
- if (makeClass)
- makeTextClass();
return true;
}
-bool BufferParams::addLayoutModules(vector<string>modNames)
-{
- bool retval = true;
- vector<string>::const_iterator it = modNames.begin();
- vector<string>::const_iterator end = modNames.end();
- for (; it != end; ++it)
- retval &= addLayoutModule(*it, false);
- makeTextClass();
- return retval;
-}
-
-
void BufferParams::clearLayoutModules() {
layoutModules_.clear();
- makeTextClass();
}