namespace {
bool moveItem(Paragraph & from, Paragraph & to,
- BufferParams const & params, pos_type i, pos_type j,
- Change change = Change(Change::INSERTED));
+ BufferParams const & params, pos_type i, pos_type j,
+ Change change = Change(Change::INSERTED));
bool moveItem(Paragraph & from, Paragraph & to,
BufferParams const & params, pos_type i, pos_type j,
if (tmpinset)
to.insertInset(j, tmpinset, tmpfont, change);
} else {
- if (!to.checkInsertChar(tmpfont))
- return false;
to.insertChar(j, tmpchar, tmpfont, change);
}
return true;
return;
}
- par.params().clear();
-
- par.layout(bparams.getLyXTextClass().defaultLayout());
-
+ if (!isempty) {
+ par.params().clear();
+ par.layout(bparams.getLyXTextClass().defaultLayout());
+ }
+
// layout stays the same with latex-environments
if (flag) {
par.layout(tmp->layout());
if (moveItem(par, tmp, bparams, i, j - pos, change))
++j;
}
-
- for (pos_type k = pos_end; k >= pos; --k)
- par.eraseIntern(k);
+ // If tracking changes, set all the text that is to be
+ // erased to Type::INSERTED.
+ for (pos_type k = pos_end; k >= pos; --k) {
+ if (bparams.tracking_changes)
+ par.setChange(k, Change::INSERTED);
+ par.erase(k);
+ }
}
}