mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 01:08:45 +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,16 +243,31 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
|||||||
cur.clearSelection(); // bug 393
|
cur.clearSelection(); // bug 393
|
||||||
cur.finishUndo();
|
cur.finishUndo();
|
||||||
InsetText * insetText = dynamic_cast<InsetText *>(inset);
|
InsetText * insetText = dynamic_cast<InsetText *>(inset);
|
||||||
if (insetText && (!insetText->allowMultiPar() || cur.lastpit() == 0)) {
|
if (insetText) {
|
||||||
// reset first par to default
|
if (insetText->getLayout(bparams).isPassThru()) {
|
||||||
cur.text()->paragraphs().begin()
|
// Fix the font of all paragraphs
|
||||||
->setPlainOrDefaultLayout(bparams.documentClass());
|
Font font(inherit_font, bparams.language);
|
||||||
cur.pos() = 0;
|
font.setLanguage(latex_language);
|
||||||
cur.pit() = 0;
|
ParagraphList::iterator par = insetText->paragraphs().begin();
|
||||||
// Merge multiple paragraphs -- hack
|
ParagraphList::iterator const end = insetText->paragraphs().end();
|
||||||
while (cur.lastpit() > 0)
|
while (par != end) {
|
||||||
mergeParagraph(bparams, cur.text()->paragraphs(), 0);
|
par->resetFonts(font);
|
||||||
cur.leaveInset(*inset);
|
par->params().clear();
|
||||||
|
++par;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!insetText->allowMultiPar() || cur.lastpit() == 0) {
|
||||||
|
// reset first par to default
|
||||||
|
cur.text()->paragraphs().begin()
|
||||||
|
->setPlainOrDefaultLayout(bparams.documentClass());
|
||||||
|
cur.pos() = 0;
|
||||||
|
cur.pit() = 0;
|
||||||
|
// Merge multiple paragraphs -- hack
|
||||||
|
while (cur.lastpit() > 0)
|
||||||
|
mergeParagraph(bparams, cur.text()->paragraphs(), 0);
|
||||||
|
cur.leaveInset(*inset);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cur.leaveInset(*inset);
|
cur.leaveInset(*inset);
|
||||||
// reset surrounding par to default
|
// reset surrounding par to default
|
||||||
@ -262,7 +277,6 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
|||||||
: dc.defaultLayoutName();
|
: dc.defaultLayoutName();
|
||||||
text->setLayout(cur, layoutname);
|
text->setLayout(cur, layoutname);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +77,8 @@ What's new
|
|||||||
|
|
||||||
- Allow using single quotes in filenames (bug 4063).
|
- Allow using single quotes in filenames (bug 4063).
|
||||||
|
|
||||||
|
- Do not insert \foreignlanguage in ERTs (bug 6426).
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user