X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fparagraph_pimpl.C;h=8c0461b83059a6e275f2f2722462430856ee05b4;hb=de161c40b1e8c5896f18f503c12cf29ec57bbf1e;hp=5e4bd220a36dd774e0458f6221661740d05bd1af;hpb=d27e1b9dd76867adc7149d32730d1d93ea58eae4;p=lyx.git diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index 5e4bd220a3..8c0461b830 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -147,7 +147,7 @@ bool Paragraph::Pimpl::isChangeEdited(pos_type start, pos_type end) const } -void Paragraph::Pimpl::setChange(pos_type pos, Change::Type type) +void Paragraph::Pimpl::setChangeType(pos_type pos, Change::Type type) { if (!tracking()) return; @@ -156,7 +156,7 @@ void Paragraph::Pimpl::setChange(pos_type pos, Change::Type type) } -void Paragraph::Pimpl::setChangeFull(pos_type pos, Change change) +void Paragraph::Pimpl::setChange(pos_type pos, Change change) { if (!tracking()) return; @@ -164,21 +164,13 @@ void Paragraph::Pimpl::setChangeFull(pos_type pos, Change change) changes_->set(change, pos); } -Change::Type Paragraph::Pimpl::lookupChange(pos_type pos) const -{ - if (!tracking()) - return Change::UNCHANGED; - return changes_->lookup(pos); -} - - -Change const Paragraph::Pimpl::lookupChangeFull(pos_type pos) const +Change const Paragraph::Pimpl::lookupChange(pos_type pos) const { if (!tracking()) return Change(Change::UNCHANGED); - return changes_->lookupFull(pos); + return changes_->lookup(pos); } @@ -212,7 +204,7 @@ void Paragraph::Pimpl::acceptChange(pos_type start, pos_type end) pos_type i = start; for (; i < end; ++i) { - switch (lookupChange(i)) { + switch (lookupChange(i).type) { case Change::UNCHANGED: break; @@ -251,7 +243,7 @@ void Paragraph::Pimpl::rejectChange(pos_type start, pos_type end) pos_type i = start; for (; i < end; ++i) { - switch (lookupChange(i)) { + switch (lookupChange(i).type) { case Change::UNCHANGED: break; @@ -378,11 +370,11 @@ bool Paragraph::Pimpl::erase(pos_type pos) BOOST_ASSERT(pos <= size()); if (tracking()) { - Change::Type changetype(changes_->lookup(pos)); - changes_->record(Change(Change::DELETED), pos); + Change::Type changetype(changes_->lookup(pos).type); // only allow the actual removal if it was /new/ text if (changetype != Change::INSERTED) { + changes_->record(Change(Change::DELETED), pos); if (pos < size() && owner_->isInset(pos)) owner_->getInset(pos)->markErased(true); return false;