}
-bool Paragraph::isFullyDeleted(pos_type start, pos_type end) const
+bool Paragraph::isDeleted(pos_type start, pos_type end) const
{
LASSERT(start >= 0 && start <= size(), /**/);
LASSERT(end > start && end <= size() + 1, /**/);
- return d->changes_.isFullyDeleted(start, end);
+ return d->changes_.isDeleted(start, end);
}
return true;
Change const change = d->changes_.lookup(size());
- return change.type == Change::INSERTED && change.author == 0;
+ return change.inserted() && change.currentAuthor();
}
* Conclusion: An inset's content should remain untouched if you delete it
*/
- if (change.type != Change::DELETED) {
+ if (!change.deleted()) {
for (pos_type pos = 0; pos < size(); ++pos) {
if (Inset * inset = getInset(pos))
inset->setChange(change);
d->changes_.set(change, pos);
// see comment in setChange(Change const &) above
- if (change.type != Change::DELETED && pos < size())
+ if (!change.deleted() && pos < size())
if (Inset * inset = getInset(pos))
inset->setChange(change);
}
// a) it was previously unchanged or
// b) it was inserted by a co-author
- if (change.type == Change::UNCHANGED ||
- (change.type == Change::INSERTED && change.author != 0)) {
+ if (!change.changed() ||
+ (change.inserted() && !change.currentAuthor())) {
setChange(pos, Change(Change::DELETED));
return false;
}
- if (change.type == Change::DELETED)
+ if (change.deleted())
return false;
}
column = 0;
}
- if (owner_->lookupChange(i).type == Change::DELETED) {
+ if (owner_->isDeleted(i)) {
if( ++runparams.inDeletedInset == 1)
runparams.changeOfDeletedInset = owner_->lookupChange(i);
}
column += os.tellp() - len;
}
- if (owner_->lookupChange(i).type == Change::DELETED)
+ if (owner_->isDeleted(i))
--runparams.inDeletedInset;
}
// do not output text which is marked deleted
// if change tracking output is disabled
- if (!bparams.outputChanges && change.type == Change::DELETED) {
+ if (!bparams.outputChanges && change.deleted()) {
continue;
}
return_value = false;
}
- if (allowcust && d->endTeXParParams(bparams, os, texrow,runparams))
+ if (allowcust && d->endTeXParParams(bparams, os, texrow, runparams))
runparams.encoding = prev_encoding;
LYXERR(Debug::LATEX, "Paragraph::latex... done " << this);
for (pos_type i = beg; i < end; ++i) {
char_type const c = d->text_[i];
if (isPrintable(c) || c == '\t'
- || (c == '\n' && options & AS_STR_NEWLINES))
+ || (c == '\n' && (options & AS_STR_NEWLINES)))
os.put(c);
- else if (c == META_INSET && options & AS_STR_INSETS) {
+ else if (c == META_INSET && (options & AS_STR_INSETS)) {
getInset(i)->tocString(os);
if (getInset(i)->asInsetMath())
os << " ";
for (pos_type i = beg; i < end; ++i) {
char_type const c = d->text_[i];
if (isPrintable(c) || c == '\t'
- || (c == '\n' && options & AS_STR_NEWLINES))
+ || (c == '\n' && (options & AS_STR_NEWLINES)))
os.put(c);
- else if (c == META_INSET && options & AS_STR_INSETS) {
+ else if (c == META_INSET && (options & AS_STR_INSETS)) {
getInset(i)->plaintext(os, runparams);
}
}
}
-bool Paragraph::isUnchanged(pos_type pos) const
+bool Paragraph::isChanged(pos_type pos) const
{
- return lookupChange(pos).type == Change::UNCHANGED;
+ return lookupChange(pos).changed();
}
bool Paragraph::isInserted(pos_type pos) const
{
- return lookupChange(pos).type == Change::INSERTED;
+ return lookupChange(pos).inserted();
}
bool Paragraph::isDeleted(pos_type pos) const
{
- return lookupChange(pos).type == Change::DELETED;
+ return lookupChange(pos).deleted();
}