#include "layout.h"
#include "lyxlex.h"
#include "support/filetools.h"
-#include "lyx_gui_misc.h"
+#include "frontends/Alert.h"
#include "debug.h"
#include "gettext.h"
#include "support/LAssert.h"
if (!lay.Read(lexrc, *this)) {
// Reslove fonts
lay.resfont = lay.font;
+#ifndef INHERIT_LANGUAGE
+ lay.resfont.realize(defaultfont());
+ lay.reslabelfont = lay.labelfont;
+ lay.reslabelfont.realize(defaultfont());
+#else
lay.resfont.realize(defaultfont(), default_language);
lay.reslabelfont = lay.labelfont;
lay.reslabelfont.realize(defaultfont(), default_language);
+#endif
return false; // no errors
}
lyxerr << "Error parsing style `" << lay.name() << "'" << endl;
if (!defaultfont_.resolved()) {
lexrc.printError("Warning: defaultfont should "
"be fully instantiated!");
+#ifndef INHERIT_LANGUAGE
+ defaultfont_.realize(LyXFont(LyXFont::ALL_SANE));
+#else
defaultfont_.realize(LyXFont(LyXFont::ALL_SANE),
default_language);
+#endif
}
break;
LyXTextClassList::NameOfClass(LyXTextClassList::size_type number) const
{
static string const dummy("dummy");
- if (classlist.size() == 0) {
+ if (classlist.empty()) {
return dummy;
}
lyx::Assert(number < classlist.size());
{
static string const dummy("dummy");
classlist[number].load();
- if (classlist.size() == 0) {
+ if (classlist.empty()) {
return dummy;
}
lyx::Assert(number < classlist.size());
LyXTextClassList::DescOfClass(LyXTextClassList::size_type number) const
{
static string const dummy("dummy");
- if (classlist.size() == 0) {
+ if (classlist.empty()) {
return dummy;
}
lyx::Assert(number < classlist.size());
"textclass file `" << MakeDisplayPath(real_file, 1000)
<< "'. Exiting." << endl;
- WriteAlert(_("LyX wasn't able to find its layout descriptions!"),
+ Alert::alert(_("LyX wasn't able to find its layout descriptions!"),
_("Check that the file \"textclass.lst\""),
_("is installed correctly. Sorry, has to exit :-("));
return false;
}
lyxerr[Debug::TCLASS] << "End of parsing of textclass.lst" << endl;
- if (classlist.size() == 0) {
+ if (classlist.empty()) {
lyxerr << "LyXTextClassList::Read: no textclasses found!"
<< endl;
- WriteAlert(_("LyX wasn't able to find any layout description!"),
- _("Check the contents of the file \"textclass.lst\""),
+ Alert::alert(_("LyX wasn't able to find any layout description!"),
+ _("Check the contents of the file \"textclass.lst\""),
_("Sorry, has to exit :-("));
return false;
}