- InsetBase * inset_hit = checkInsetHit(cur.x_target(), y);
- if (inset_hit && isHighlyEditableInset(inset_hit))
- inset_hit->editXY(cur, cur.x_target(), y);
+ int const y = bv_funcs::getPos(cur).y_;
+ LCursor old = cur;
+ editXY(cur, x, y + par.rows()[row].descent() + 1);
+
+ // This happens when you move out of an inset.
+ // And to give the DEPM the possibility of doing
+ // something we must provide it with two different
+ // cursors. (Lgb)
+ LCursor dummy = cur;
+ if (dummy == old)
+ ++dummy.pos();
+
+ bool const changed = deleteEmptyParagraphMechanism(dummy, old);
+
+ // Make sure that cur gets back whatever happened to dummy(Lgb)
+ if (changed)
+ cur = dummy;
+
+ return changed;
+
+ }
+
+ bool updateNeeded = false;
+
+ if (row + 1 < int(par.rows().size())) {
+ updateNeeded |= setCursor(cur, cur.pit(),
+ x2pos(cur.pit(), row + 1, x));
+ } else if (cur.pit() + 1 < int(paragraphs().size())) {
+ ++cur.pit();
+ updateNeeded |= setCursor(cur, cur.pit(),
+ x2pos(cur.pit(), 0, x));