Fix bug #7905. We don't want to move out of the inset unless

we've put something into it. (We also don't need to copy an
empty string into it.)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40240 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-11-22 18:40:01 +00:00
parent c58290e5f1
commit d38d332d9f

View File

@ -247,8 +247,11 @@ static bool doInsertInset(Cursor & cur, Text * text,
inset->edit(cur, true);
// Now put this into inset
Font const f(inherit_font, cur.current_font.language());
cur.text()->insertStringAsLines(cur, ds, f);
cur.leaveInset(*inset);
if (!ds.empty()) {
cur.text()->insertStringAsLines(cur, ds, f);
cur.leaveInset(*inset);
inset->asInsetCollapsable()->setStatus(InsetCollapsable::Collapsed);
}
return true;
}