}
-bool Changes::Range::loose_contains(pos_type const pos) const
+bool Changes::Range::containsOrPrecedes(pos_type const pos) const
{
return pos >= start && pos <= end;
}
erase(pos);
}
break;
- } else if (range.loose_contains(pos) && it + 1 == table_.end()) {
+ } else if (range.containsOrPrecedes(pos) && it + 1 == table_.end()) {
// this case happens when building from .lyx
set(change, pos);
break;
for (; it != end; ++it) {
Range & range(it->range);
- if (!found && range.loose_contains(pos)) {
+ if (!found && range.containsOrPrecedes(pos)) {
found = true;
if (lyxerr.debugging(Debug::CHANGES)) {
lyxerr[Debug::CHANGES] << "Found range of "
}
-Change const Changes::lookupFull(pos_type const pos) const
+Change const Changes::lookup(pos_type const pos) const
{
if (!table_.size()) {
if (lyxerr.debugging(Debug::CHANGES))
}
-Change::Type Changes::lookup(pos_type const pos) const
-{
- if (!table_.size()) {
- if (lyxerr.debugging(Debug::CHANGES))
- lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
- return empty_type_;
- }
-
- ChangeTable::const_iterator it = table_.begin();
- ChangeTable::const_iterator end = table_.end();
-
- for (; it != end; ++it) {
- if (it->range.contains(pos))
- return it->change.type;
- }
-
- check();
- BOOST_ASSERT(false && "missing changes for pos");
- return Change::UNCHANGED;
-}
-
-
bool Changes::isChange(pos_type const start, pos_type const end) const
{
if (!table_.size()) {
int Changes::latexMarkChange(std::ostream & os,
- Change::Type const old, Change::Type const change)
+ Change::Type const old, Change::Type const change,
+ bool const & output)
{
- if (old == change)
+ if (!output || old == change)
return 0;
string const start("\\changestart{}");