- lex.printError("Unknown bar font flag "
- "`$$Token'");
- } else if (token == "\\noun") {
- lex.next();
- font.setNoun(font.setLyXMisc(lex.GetString()));
- } else if (token == "\\color") {
- lex.next();
- font.setLyXColor(lex.GetString());
- } else if (token == "\\align") {
- tmpret = lex.FindToken(string_align);
- if (tmpret == -1) tmpret++;
- if (tmpret != LYX_LAYOUT_DEFAULT) {
- tmpret2 = 1;
- for (; tmpret>0; tmpret--)
- tmpret2 = tmpret2 * 2;
- par->align = LyXAlignment(tmpret2);
- }
- } else if (token == "\\added_space_top"){
- lex.nextToken();
- par->added_space_top = lex.GetString();
- } else if (token == "\\added_space_bottom") {
- lex.nextToken();
- par->added_space_bottom = lex.GetString();
- } else if (token == "\\pextra_type") {
- lex.nextToken();
- par->pextra_type = lex.GetInteger();
- } else if (token == "\\pextra_width") {
- lex.nextToken();
- par->pextra_width = lex.GetString();
- } else if (token == "\\pextra_widthp") {
- lex.nextToken();
- par->pextra_widthp = lex.GetString();
- } else if (token == "\\pextra_alignment") {
- lex.nextToken();
- par->pextra_alignment = lex.GetInteger();
- } else if (token == "\\pextra_hfill") {
- lex.nextToken();
- par->pextra_hfill = lex.GetInteger();
- } else if (token == "\\pextra_start_minipage") {
- lex.nextToken();
- par->pextra_start_minipage = lex.GetInteger();
- } else if (token == "\\labelwidthstring") {
- lex.EatLine();
- par->labelwidthstring = lex.GetString();
- /* do not delete this token, it is still needed! */
- } else if (token == "\\end_inset") {
- /* simple ignore this. The insets do not have
- * to read this */
- // but insets should read it, it is a part of
- //the inset isn't it? Lgb.
- } else if (token == "\\begin_inset") {
- lex.next();
- tmptok = lex.GetString();
- /* test the different insets */
- if (tmptok == "Quotes") {
- inset = new InsetQuotes;
- inset->Read(lex);
- par->InsertChar(pos, LyXParagraph::META_INSET);
- par->InsertInset(pos, inset);
- par->SetFont(pos, font);
- pos++;
-#if 0 // should not be used any more
- } else if (tmptok == "Latex") {
- // This one is on its way out
- lex.EatLine();
- tmptok = strip(lex.GetString());
- //lyxerr <<string(tmptok[0]));
- if (tmptok[0] == '\\') {
- // then this latex is a
- // latex command
- InsetCommand *tmpinset =
- new InsetCommand();
- tmpinset->scanCommand(tmptok);
- inset = tmpinset;
- } else {
- // This should not use InsetLaTexDel
- // it should rather insert text into
- // the paragraph and mark it as tex.
- inset = new InsetLatex(tmptok);
- }
- par->InsertChar(pos, LyXParagraph::META_INSET);
- par->InsertInset(pos, inset);
- par->SetFont(pos, font);
- pos++;
+ font.setLanguage(params.language_info);
+ else
+ lex.printError("Unknown direction `$$Token'");
+ } else if (token == "\\emph") {
+ lex.next();
+ font.setEmph(font.setLyXMisc(lex.GetString()));
+ } else if (token == "\\bar") {
+ lex.next();
+ string tok = lex.GetString();
+ // This is dirty, but gone with LyX3. (Asger)
+ if (tok == "under")
+ font.setUnderbar(LyXFont::ON);
+ else if (tok == "no")
+ font.setUnderbar(LyXFont::OFF);
+ else if (tok == "default")
+ font.setUnderbar(LyXFont::INHERIT);
+ else
+ lex.printError("Unknown bar font flag "
+ "`$$Token'");
+ } else if (token == "\\noun") {
+ lex.next();
+ font.setNoun(font.setLyXMisc(lex.GetString()));
+ } else if (token == "\\color") {
+ lex.next();
+ font.setLyXColor(lex.GetString());
+ } else if (token == "\\align") {
+ tmpret = lex.FindToken(string_align);
+ if (tmpret == -1) ++tmpret;
+ if (tmpret != LYX_LAYOUT_DEFAULT) { // tmpret != 99 ???
+ tmpret2 = 1;
+ for (; tmpret > 0; --tmpret)
+ tmpret2 = tmpret2 * 2;
+ par->align = LyXAlignment(tmpret2);
+ }
+ } else if (token == "\\added_space_top") {
+ lex.nextToken();
+ par->added_space_top = VSpace(lex.GetString());
+ } else if (token == "\\added_space_bottom") {
+ lex.nextToken();
+ par->added_space_bottom = VSpace(lex.GetString());
+ } else if (token == "\\pextra_type") {
+ lex.nextToken();
+ par->pextra_type = lex.GetInteger();
+ } else if (token == "\\pextra_width") {
+ lex.nextToken();
+ par->pextra_width = lex.GetString();
+ } else if (token == "\\pextra_widthp") {
+ lex.nextToken();
+ par->pextra_widthp = lex.GetString();
+ } else if (token == "\\pextra_alignment") {
+ lex.nextToken();
+ par->pextra_alignment = lex.GetInteger();
+ } else if (token == "\\pextra_hfill") {
+ lex.nextToken();
+ par->pextra_hfill = lex.GetInteger();
+ } else if (token == "\\pextra_start_minipage") {
+ lex.nextToken();
+ par->pextra_start_minipage = lex.GetInteger();
+ } else if (token == "\\labelwidthstring") {
+ lex.EatLine();
+ par->labelwidthstring = lex.GetString();
+ /* do not delete this token, it is still needed! */
+ } else if (token == "\\end_inset") {
+ /* simple ignore this. The insets do not have
+ * to read this */
+ // but insets should read it, it is a part of
+ //the inset isn't it? Lgb.
+ } else if (token == "\\begin_inset") {
+ lex.next();
+ tmptok = lex.GetString();
+ /* test the different insets */
+ if (tmptok == "Quotes") {
+ inset = new InsetQuotes;
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "\\i") {
+ inset = new InsetLatexAccent;
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "FormulaMacro") {
+ inset = new InsetFormulaMacro;
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "Formula") {
+ inset = new InsetFormula;
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "Figure") {
+ inset = new InsetFig(100, 100, this);
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "Info") {
+ inset = new InsetInfo;
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "Include") {
+ inset = new InsetInclude(string(), this);
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "ERT") {
+ inset = new InsetERT(this);
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+ } else if (tmptok == "Text") {
+ inset = new InsetText(this);
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;
+#if 0
+ } else if (tmptok == "Number") {
+ inset = new InsetNumber(this);
+ inset->Read(lex);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
+ par->InsertInset(pos, inset);
+ par->SetFont(pos, font);
+ ++pos;