move some code fro, InsetCollapsable::read to InsetText

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30563 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-07-14 13:05:13 +00:00
parent e33095f10d
commit e84d752414
2 changed files with 8 additions and 10 deletions

View File

@ -169,18 +169,8 @@ void InsetCollapsable::read(Lexer & lex)
if (tmp_token == "open")
status_ = Open;
// this must be set before we enter InsetText::read()
InsetText::read(lex);
setButtonLabel();
// Force default font, if so requested
// This avoids paragraphs in buffer language that would have a
// foreign language after a document language change, and it ensures
// that all new text in ERT and similar 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.
fixParagraphsFont();
}

View File

@ -174,6 +174,14 @@ void InsetText::read(Lexer & lex)
// ensure we have at least one paragraph.
if (paragraphs().empty())
paragraphs().push_back(oldpar);
// Force default font, if so requested
// This avoids paragraphs in buffer language that would have a
// foreign language after a document language change, and it ensures
// that all new text in ERT and similar 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.
fixParagraphsFont();
}