]> git.lyx.org Git - lyx.git/blobdiff - src/layout.C
Fixed cut&paste bugs and added freespacing for ERT Insets.
[lyx.git] / src / layout.C
index e1db0bd5bf04b975bcfd451d4fbcb5dc9df50811..ba04bcb15de65568772b682b547dd4fbc78fa05b 100644 (file)
@@ -20,7 +20,7 @@
 #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"
@@ -776,9 +776,15 @@ bool LyXTextClass::do_readStyle(LyXLex & lexrc, LyXLayout & lay)
        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;
@@ -939,8 +945,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        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;
 
@@ -1281,7 +1291,7 @@ string const &
 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());
@@ -1295,7 +1305,7 @@ LyXTextClassList::LatexnameOfClass(LyXTextClassList::size_type number) const
 {
        static string const dummy("dummy");
        classlist[number].load();
-       if (classlist.size() == 0) {
+       if (classlist.empty()) {
                return dummy;
        }
        lyx::Assert(number < classlist.size());
@@ -1308,7 +1318,7 @@ string const &
 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());
@@ -1356,7 +1366,7 @@ bool LyXTextClassList::Read ()
                        "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;
@@ -1417,11 +1427,11 @@ bool LyXTextClassList::Read ()
        }
        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;
        }