#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 "frontends/Alert.h"
+
#include <cstdlib>
#include <algorithm>
using std::endl;
using std::pair;
-#ifdef WITH_WARNINGS
-#warning Do we need this horrible thing? (JMarc)
-#endif
-bool use_babel;
BufferParams::BufferParams()
// Initialize textclass to point to article. if `first' is
textclass = 0;
return classname;
}
+ if (!getLyXTextClass().isTeXClassAvailable()) {
+ string msg = bformat(_("The document uses a missing "
+ "TeX class \"%1$s\".\n"), classname);
+ 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") {
tracking_changes = lex.getInteger();
} else if (token == "\\author") {
lex.nextToken();
- istringstream ss(lex.getString());
+ istringstream ss(STRCONV(lex.getString()));
Author a;
ss >> a;
- int aid(authorlist.record(a));
- author_ids.push_back(aid);
+ author_map.push_back(authorlist.record(a));
} else if (token == "\\paperorientation") {
int tmpret = lex.findToken(string_orientation);
if (tmpret == -1)
}
-void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
+bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
TexRow & texrow) const
{
os << "\\documentclass";
clsoptions << "landscape,";
// language should be a parameter to \documentclass
- use_babel = false;
- ostringstream language_options;
if (language->babel() == "hebrew"
&& default_language->babel() != "hebrew")
// This seems necessary
features.useLanguage(default_language);
- if (lyxrc.language_use_babel ||
- language->lang() != lyxrc.default_language ||
- features.hasLanguages()) {
- use_babel = true;
+ ostringstream language_options;
+ bool const use_babel = features.useBabel();
+ if (use_babel) {
language_options << features.getLanguages();
language_options << language->babel();
if (lyxrc.language_global_options)
}
os << lyxpreamble;
+ return use_babel;
}
void BufferParams::setPaperStuff()