+void InsetERT::read(Buffer const & buf, LyXLex & lex)
+{
+ InsetCollapsable::read(buf, lex);
+
+ // Force default font
+ // This avoids paragraphs in buffer language that would have a
+ // foreign language after a document langauge change, and it ensures
+ // that all new text in ERT gets the "latex" language, since new text
+ // inherits the language from the last position of the existing text.
+ // As a side effect this makes us also robust against bugs in LyX
+ // that might lead to font changes in ERT in .lyx files.
+ LyXFont font(LyXFont::ALL_INHERIT, latex_language);
+ ParagraphList::iterator par = paragraphs().begin();
+ ParagraphList::iterator const end = paragraphs().end();
+ while (par != end) {
+ pos_type siz = par->size();
+ for (pos_type i = 0; i <= siz; ++i) {
+ par->setFont(i, font);
+ }
+ ++par;
+ }
+}
+
+
+docstring const InsetERT::editMessage() const