if (!target_inset->insetAllowed(inset->lyxCode()))
tmpbuf->eraseChar(i--, false);
}
-
- if (lyxrc.ct_markup_copied) {
- // Only remove deleted text and change
- // the rest to inserted if ct is active,
- // otherwise leave markup as is
- if (buffer.params().track_changes && tmpbuf->size() > 0) {
- if (!isFullyDeleted(insertion))
- tmpbuf->acceptChanges(0, tmpbuf->size());
- else
- tmpbuf->rejectChanges(0, tmpbuf->size());
- tmpbuf->setChange(Change(Change::INSERTED));
- }
- } else
- // Resolve all markup to inserted or unchanged
- // Deleted text has already been removed on copy
- // (copySelectionHelper)
- tmpbuf->setChange(Change(buffer.params().track_changes ?
- Change::INSERTED : Change::UNCHANGED));
}
bool const target_empty = pars[pit].empty();
}
insertion.swap(in.paragraphs());
+ // We need to do this here, after the inset handling above,
+ // as acceptChanges() and rejectChanges() might access inset buffers.
+ tmpbuf = insertion.begin();
+ for (; tmpbuf != insertion.end(); ++tmpbuf) {
+ if (lyxrc.ct_markup_copied) {
+ // Only remove deleted text and change
+ // the rest to inserted if ct is active,
+ // otherwise leave markup as is
+ if (buffer.params().track_changes) {
+ if (tmpbuf->size() > 0) {
+ if (!isFullyDeleted(insertion))
+ tmpbuf->acceptChanges(0, tmpbuf->size());
+ else
+ tmpbuf->rejectChanges(0, tmpbuf->size());
+ }
+ tmpbuf->setChange(Change(Change::INSERTED));
+ }
+ } else
+ // Resolve all markup to inserted or unchanged
+ // Deleted text has already been removed on copy
+ // (copySelectionHelper)
+ tmpbuf->setChange(Change(buffer.params().track_changes ?
+ Change::INSERTED : Change::UNCHANGED));
+ }
+
// Split the paragraph for inserting the buf if necessary.
if (!target_empty)
breakParagraphConservative(buffer.params(), pars, pit, pos);
if (begpit != endpit)
cur.screenUpdateFlags(Update::Force | Update::FitCursor);
+ else
+ cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
tie(endpit, endpos) =
eraseSelectionHelper(bp, text->paragraphs(), begpit, endpit,