+ // We will store in otherstack the part of the document under 'undo'
+ Buffer * buf = bv.buffer();
+ DocIterator cell_dit = undo.cell.asDocIterator(&buf->inset());
+
+ doRecordUndo(Undo::ATOMIC, cell_dit,
+ undo.from, cell_dit.lastpit() - undo.end, bv.cursor(),
+ undo.bparams, undo.isFullBuffer,
+ otherstack);
+
+ // This does the actual undo/redo.
+ //lyxerr << "undo, performing: " << undo << std::endl;
+ DocIterator dit = undo.cell.asDocIterator(&buf->inset());
+ if (undo.isFullBuffer) {
+ // This is a full document
+ otherstack.top().bparams = buf->params();
+ buf->params() = undo.bparams;
+ buf->paragraphs() = undo.pars;
+ } else if (dit.inMathed()) {