BOOST_ASSERT(paragraphs().empty());
readHeader(lex);
- if (!params().getTextClass().load(filePath())) {
- string theclass = params().getTextClass().name();
+ TextClass const & baseClass = textclasslist[params().getBaseClass()];
+ if (!baseClass.load(filePath())) {
+ string theclass = baseClass.name();
Alert::error(_("Can't load document class"), bformat(
_("Using the default document class, because the "
"class %1$s could not be loaded."), from_utf8(theclass)));
bool BufferParams::setBaseClass(textclass_type tc)
{
- if (!textclasslist[tc].load()) {
- docstring s = bformat(_("The document class %1$s."
- "could not be loaded."),
+ bool retVal = true;
+ 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);
- return false;
+ retVal = false;
}
-
- baseClass_ = tc;
makeTextClass();
- return true;
+ return retVal;
}