}
-void Paragraph::Pimpl::markErased()
+void Paragraph::Pimpl::markErased(bool erased)
{
BOOST_ASSERT(tracking());
- // FIXME: we should actually remove INSERTED chars.
- // difficult because owning insettexts/tabulars need
- // to update themselves when rows etc. change
- changes_->set(Change::DELETED, 0, size());
- changes_->reset(Change::DELETED);
+ if (erased) {
+ erase(0, size());
+ } else {
+ for (pos_type i = 0; i < size(); ++i) {
+ changes_->set(Change::UNCHANGED, i);
+ if (owner_->isInset(i))
+ owner_->getInset(i)->markErased(false);
+ }
+ }
}
return;
}
- lyxerr << "acceptchange" << endl;
+ lyxerr[Debug::CHANGES] << "acceptchange" << endl;
pos_type i = start;
for (; i < end; ++i) {
}
}
- lyxerr << "endacceptchange" << endl;
+ lyxerr[Debug::CHANGES] << "endacceptchange" << endl;
changes_->reset(Change::UNCHANGED);
}
case Change::DELETED:
changes_->set(Change::UNCHANGED, i);
+ if (owner_->isInset(i))
+ owner_->getInset(i)->markErased(false);
break;
}
}
// only allow the actual removal if it was /new/ text
if (changetype != Change::INSERTED) {
- if (owner_->text_[pos] == Paragraph::META_INSET) {
- owner_->getInset(pos)->markErased();
- }
+ if (owner_->isInset(pos))
+ owner_->getInset(pos)->markErased(true);
return false;
}
}
break;
}
+ // output change tracking marks only if desired,
+ // if dvipost is installed,
+ // and with dvi/ps (other formats don't work)
+ LaTeXFeatures features(buf, bparams, runparams.nice);
+ bool const output = bparams.output_changes
+ && runparams.flavor == OutputParams::LATEX
+ && features.isAvailable("dvipost");
+
if (inset->isTextInset()) {
column += Changes::latexMarkChange(os, running_change,
- Change::UNCHANGED);
+ Change::UNCHANGED, output);
running_change = Change::UNCHANGED;
}