mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
branch: Fix bug #6426: Language not set correctly when inserting an Inset.
see r32750. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@32807 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7554c40dbb
commit
39d43fcd78
@ -243,7 +243,21 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
cur.clearSelection(); // bug 393
|
||||
cur.finishUndo();
|
||||
InsetText * insetText = dynamic_cast<InsetText *>(inset);
|
||||
if (insetText && (!insetText->allowMultiPar() || cur.lastpit() == 0)) {
|
||||
if (insetText) {
|
||||
if (insetText->getLayout(bparams).isPassThru()) {
|
||||
// Fix the font of all paragraphs
|
||||
Font font(inherit_font, bparams.language);
|
||||
font.setLanguage(latex_language);
|
||||
ParagraphList::iterator par = insetText->paragraphs().begin();
|
||||
ParagraphList::iterator const end = insetText->paragraphs().end();
|
||||
while (par != end) {
|
||||
par->resetFonts(font);
|
||||
par->params().clear();
|
||||
++par;
|
||||
}
|
||||
}
|
||||
|
||||
if (!insetText->allowMultiPar() || cur.lastpit() == 0) {
|
||||
// reset first par to default
|
||||
cur.text()->paragraphs().begin()
|
||||
->setPlainOrDefaultLayout(bparams.documentClass());
|
||||
@ -253,6 +267,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
while (cur.lastpit() > 0)
|
||||
mergeParagraph(bparams, cur.text()->paragraphs(), 0);
|
||||
cur.leaveInset(*inset);
|
||||
}
|
||||
} else {
|
||||
cur.leaveInset(*inset);
|
||||
// reset surrounding par to default
|
||||
@ -262,7 +277,6 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
: dc.defaultLayoutName();
|
||||
text->setLayout(cur, layoutname);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,8 @@ What's new
|
||||
|
||||
- Allow using single quotes in filenames (bug 4063).
|
||||
|
||||
- Do not insert \foreignlanguage in ERTs (bug 6426).
|
||||
|
||||
|
||||
* USER INTERFACE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user