}
+bool Paragraph::Pimpl::isMergedOnEndOfParDeletion(bool trackChanges) const {
+ // keep the logic here in sync with the logic of eraseChars()
+
+ if (!trackChanges) {
+ return true;
+ }
+
+ Change change = changes_.lookup(size());
+
+ return change.type == Change::INSERTED && change.author == 0;
+}
+
+
void Paragraph::Pimpl::setChange(Change const & change)
{
// beware of the imaginary end-of-par character!
{
BOOST_ASSERT(pos >= 0 && pos <= size());
+ // keep the logic here in sync with the logic of isMergedOnEndOfParDeletion()
+
if (trackChanges) {
Change change = changes_.lookup(pos);
int Paragraph::Pimpl::eraseChars(pos_type start, pos_type end, bool trackChanges)
{
BOOST_ASSERT(start >= 0 && start <= size());
- BOOST_ASSERT(end > start && end <= size() + 1);
+ BOOST_ASSERT(end >= start && end <= size() + 1);
pos_type i = start;
for (pos_type count = end - start; count; --count) {