#include <iomanip>
#include <cstdlib>
+#include <cmath>
#include <unistd.h>
#include <sys/types.h>
#include <utime.h>
if (pp.first) {
params.textclass = pp.second;
} else {
- lex.printError("Unknown textclass `$$Token'");
+ WriteAlert(string(_("Textclass error")),
+ string(_("The document uses an unknown textclass \"")) +
+ lex.GetString() + string("\"."),
+ string(_("LyX will not be able to produce output correctly.")));
params.textclass = 0;
}
if (!textclasslist.Load(params.textclass)) {
int tmpret = lex.FindToken(string_align);
if (tmpret == -1) ++tmpret;
if (tmpret != LYX_LAYOUT_DEFAULT) { // tmpret != 99 ???
+#if 0
int tmpret2 = 1;
for (; tmpret > 0; --tmpret)
tmpret2 = tmpret2 * 2;
+#else
+ int const tmpret2 = int(pow(2.0, tmpret));
+#endif
+ //lyxerr << "Tmpret2 = " << tmpret2 << endl;
par->align = LyXAlignment(tmpret2);
}
} else if (token == "\\added_space_top") {
LyXFont font2;
Inset const * inset;
char c;
+#ifndef NEW_INSETS
LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
+#endif
char depth = 0;
int ltype = 0;
int ltype_depth = 0;
font1 = LyXFont(LyXFont::ALL_INHERIT, params.language);
for (LyXParagraph::size_type i = 0; i < par->size(); ++i) {
- if (!i && !footnoteflag && !noparbreak){
+ if (!i &&
+#ifndef NEW_INSETS
+ !footnoteflag &&
+#endif
+ !noparbreak) {
if (linelen > 0)
buffer << "\n\n";
for (char j = 0; j < depth; ++j)
#warning Use a real stack! (Lgb)
#endif
// Please, Lars, do not remove the global variable. I already
- // had to reintroduce it twice! (JMarc)
+ // had to reintroduce it twice! (JMarc)
+ // but...but... I'll remove it anyway. (well not quite) (Lgb)
+#if 0
int j;
// pop all tags till specified one
// push all tags, but the specified one
for (j = j + 1; j <= pos; ++j) {
os << "<" << stack[j] << ">";
- strcpy(stack[j-1], stack[j]);
+ strcpy(stack[j - 1], stack[j]);
}
--pos;
+#else
+ // pop all tags till specified one
+ int j = pos;
+ for (int j = pos; (j >= 0) && (strcmp(stack[j], tag.c_str())); --j)
+ os << "</" << stack[j] << ">";
+
+ // closes the tag
+ os << "</" << tag << ">";
+
+ // push all tags, but the specified one
+ for (int i = j + 1; i <= pos; ++i) {
+ os << "<" << stack[i] << ">";
+ strcpy(stack[i - 1], stack[i]);
+ }
+ --pos;
+#endif
}