mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix crash noticed by Vincent. We don't know that insetText is non-null here!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26112 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4e2d14a363
commit
b3c5c1ca89
@ -225,7 +225,7 @@ 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 && (!insetText->allowMultiPar() || cur.lastpit() == 0)) {
|
||||
// reset first par to default
|
||||
cur.text()->paragraphs().begin()
|
||||
->setPlainOrDefaultLayout(bparams.documentClass());
|
||||
@ -238,9 +238,10 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
} else {
|
||||
cur.leaveInset(*inset);
|
||||
// reset surrounding par to default
|
||||
docstring const layoutname = insetText->usePlainLayout()
|
||||
? bparams.documentClass().plainLayoutName()
|
||||
: bparams.documentClass().defaultLayoutName();
|
||||
DocumentClass const & dc = bparams.documentClass();
|
||||
docstring const layoutname = inset->usePlainLayout()
|
||||
? dc.plainLayoutName()
|
||||
: dc.defaultLayoutName();
|
||||
text->setLayout(cur, layoutname);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user