- case LFUN_INSET_DISSOLVE: {
- recordUndoInset(cur);
- cur.selHandle(false);
- // save position
- lyx::pos_type spos = cur.pos();
- lyx::pit_type spit = cur.pit();
- ParagraphList plist;
- if (cur.lastpit() != 0 || cur.lastpos() != 0)
- plist = paragraphs();
- cur.popLeft();
- // store cursor offset
- if (spit == 0)
- spos += cur.pos();
- spit += cur.pit();
- cur.paragraph().erase(cur.pos());
- if (!plist.empty()) {
- Buffer * b = bv->buffer();
- pasteParagraphList(cur, plist, b->params().textclass,
- b->errorList("Paste"));
- // restore position
- cur.pit() = std::min(cur.lastpit(), spit);
- cur.pos() = std::min(cur.lastpos(), spos);
- }
- cur.clearSelection();
- cur.resetAnchor();
- needsUpdate = true;