]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
don't rm emergency saves ever
[lyx.git] / src / bufferparams.C
index 3fc1794eb135b0dcc081e40dd57b721eeb102ff1..a58a8fdc07f2f49ed8451dfdf15e906709079d61 100644 (file)
 #include "lyxlex.h"
 #include "Lsstream.h"
 #include "author.h"
+#include "gettext.h"
 
 #include "support/lyxalgo.h" // for lyx::count
 #include "support/lyxlib.h"
 #include "support/lstrings.h"
 #include "support/types.h"
+#include "support/BoostFormat.h"
+
+#include "frontends/Alert.h"
 
 #include <cstdlib>
 #include <algorithm>
@@ -92,6 +96,16 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                        textclass = 0;
                        return classname;
                }
+               if (!getLyXTextClass().isTeXClassAvailable()) {
+                       string msg =
+#if USE_BOOST_FORMAT
+                               boost::io::str(boost::format(_("The document uses a missing TeX class \"%1$s\".\n")) % classname);
+#else
+                               _("The document uses a missing TeX class ") + classname + ".\n";
+#endif
+                       Alert::warning(_("Document class not available"),
+                                      msg + _("LyX will not be able to produce output."));
+               }
        } else if (token == "\\begin_preamble") {
                readPreamble(lex);
        } else if (token == "\\options") {
@@ -189,7 +203,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                istringstream ss(lex.getString());
                Author a;
                ss >> a;
-               authorlist.record(a);
+               author_map.push_back(authorlist.record(a));
        } else if (token == "\\paperorientation") {
                int tmpret = lex.findToken(string_orientation);
                if (tmpret == -1)