}
// create a new Undo
- Paragraph * undopar;
+ Paragraph * undopar = 0; // nothing to replace yet (undo of delete maybe)
- Paragraph * start = const_cast<Paragraph *>(first);
- Paragraph * end = 0;
+ Paragraph * start = first;
+ Paragraph * end = &*boost::prior(itbehind);
- if (behind)
- end = const_cast<Paragraph*>(behind->previous());
- else {
- end = start;
- while (end->next())
- end = end->next();
- }
if (start && end && (start != end->next()) &&
((before_number != behind_number) ||
((before_number < 0) && (behind_number < 0))))
tmppar2 = tmppar2->next();
}
tmppar2->next(0);
- } else
- undopar = 0; // nothing to replace (undo of delete maybe)
+ }
int cursor_par = undoCursor(bv).par()->id();
- int cursor_pos = undoCursor(bv).pos();
+ int cursor_pos = undoCursor(bv).pos();
u.reset(new Undo(kind, inset_id,
before_number, behind_number,
if (first) {
shared_ptr<Undo> u;
if (createUndo(bv, undo->kind, first,
- &*b->getParFromID(undo->number_of_behind_par), u))
+ b->getParFromID(undo->number_of_behind_par), u))
b->redostack.push(u);
}
}
{
if (!undo_frozen) {
shared_ptr<Undo> u;
- if (createUndo(bv, kind, &*first, &*behind, u))
+ if (createUndo(bv, kind, first, behind, u))
bv->buffer()->undostack.push(u);
bv->buffer()->redostack.clear();
}
ParagraphList::iterator first, ParagraphList::iterator behind)
{
shared_ptr<Undo> u;
- if (createUndo(bv, kind, &*first, &*behind, u))
+ if (createUndo(bv, kind, first, behind, u))
bv->buffer()->redostack.push(u);
}