mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
* doInsertInset(): return early.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22891 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
225bf49cf9
commit
bd8cba506f
@ -197,7 +197,9 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
inset->edit(cur, true);
|
||||
// Now put this into inset
|
||||
static_cast<InsetCollapsable *>(inset)->text_.insertStringAsParagraphs(cur, ds);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool gotsel = false;
|
||||
if (cur.selection()) {
|
||||
lyx::dispatch(FuncRequest(LFUN_CUT));
|
||||
@ -208,11 +210,12 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
if (edit)
|
||||
inset->edit(cur, true);
|
||||
|
||||
if (gotsel && pastesel) {
|
||||
if (!gotsel || !pastesel)
|
||||
return true;
|
||||
|
||||
lyx::dispatch(FuncRequest(LFUN_PASTE, "0"));
|
||||
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
|
||||
LayoutPtr const layout =
|
||||
cur.buffer().params().getTextClass().defaultLayout();
|
||||
@ -231,8 +234,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
|
||||
cur.leaveInset(*inset);
|
||||
text->setLayout(cur, layoutname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user