}
+void InsetERT::resetParagraphsFont()
+{
+ Font font(Font::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->params().clear();
+ ++par;
+ }
+}
+
+
void InsetERT::write(Buffer const & buf, ostream & os) const
{
os << "ERT" << "\n";
// 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.
- Font font(Font::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;
- }
+ resetParagraphsFont();
}
// attributes.
// FIXME: Change only the pasted paragraphs
- Font font = layout->font;
// ERT contents has always latex_language
- font.setLanguage(latex_language);
- ParagraphList::iterator const end = paragraphs().end();
- for (ParagraphList::iterator par = paragraphs().begin();
- par != end; ++par) {
- // in case par had a manual label
- par->setBeginOfBody();
- pos_type const siz = par->size();
- for (pos_type i = 0; i < siz; ++i) {
- par->setFont(i, font);
- }
- par->params().clear();
- }
+ resetParagraphsFont();
break;
}
default:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+ ///
+ void resetParagraphsFont();
+
private:
virtual Inset * clone() const;
///