On Sat, Dec 08, 2001 at 03:12:27PM +0100, Lars Gullik Bjønnes wrote: > Ok it seems that this patch solves the whole problem (buffer.C): > @@ -388,12 +391,14 @@ bool Buffer::readLyXformat2(LyXLex & lex > void Buffer::insertErtContents(Paragraph * par, int & pos, > - LyXFont const & font, bool set_inactive) > + LyXFont const & f, bool set_inactive) > { > if (!ert_comp.contents.empty()) { > - lyxerr[Debug::INSETS] << "ERT contents:\n" > - << ert_comp.contents << endl; > + lyxerr[Debug::INSETS] << "ERT contents:\n'" > + << ert_comp.contents << "'" << endl; > Inset * inset = new InsetERT(ert_comp.contents, true); > + LyXFont font; > + font.setLanguage(f.language()); > par->insertInset(pos++, inset, font); > ert_comp.contents.erase();
I think that this patch is wrong: The old code of insertErtContents is correct, but the problem is that the wrong font is passed to it when the method is called. Consider the attached lyx file. The latex output should be abc in bold. With the new code, the b is not bold (it was OK in the old code).
#LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 218 \textclass article \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard \latex latex \backslash def \backslash foo#1{#1} \layout Standard \series bold a \latex latex \backslash foo{b} \latex default c \the_end