errorList.push_back(ErrorItem(_("Change tracking error"),
bformat(_("Unknown author index for insertion: %1$d\n"), aid),
par.id(), 0, par.size()));
-
change = Change(Change::UNCHANGED);
} else
change = Change(Change::INSERTED, bp.author_map[aid], ct);
errorList.push_back(ErrorItem(_("Change tracking error"),
bformat(_("Unknown author index for deletion: %1$d\n"), aid),
par.id(), 0, par.size()));
-
change = Change(Change::UNCHANGED);
} else
change = Change(Change::DELETED, bp.author_map[aid], ct);
Change change(Change::UNCHANGED);
while (lex.isOK()) {
-
readParToken(buf, par, lex, token, font, change, errorList);
lex.nextToken();
// It is better to erase the space (Dekel)
if (cur.pos() != cur.lastpos() && cpar.isLineSeparator(cur.pos()))
// FIXME: change tracking (MG)
- cpar.erase(cur.pos(), cur.buffer().params().trackChanges);
+ cpar.eraseChar(cur.pos(), cur.buffer().params().trackChanges);
// How should the layout for the new paragraph be?
int preserve_layout = 0;
while (!pars_[next_par].empty() && pars_[next_par].isNewline(0))
// FIXME: change tracking (MG)
- pars_[next_par].erase(0, cur.buffer().params().trackChanges);
+ pars_[next_par].eraseChar(0, cur.buffer().params().trackChanges);
ParIterator current_it(cur);
ParIterator last_it(cur);
}
}
- // FIXME: change tracking (MG)
- par.insertChar(cur.pos(), c, current_font, Change(Change::INSERTED));
+ par.insertChar(cur.pos(), c, current_font, cur.buffer().params().trackChanges);
setCursor(cur, cur.pit(), cur.pos() + 1, false, cur.boundary());
charInserted();
}
break;
}
}
-#ifdef WITH_WARNINGS
-#warning changes
-#endif
- pars_[pit].setChar(pos, c);
+
+ // FIXME: change tracking (MG)
+ // sorry but we are no longer allowed to set a single character directly
+ // we have to rewrite this method in terms of erase&insert operations
+ //pars_[pit].setChar(pos, c);
++pos;
}
}
setCursorIntern(cur, cur.pit(), cur.pos() - 1,
false, cur.boundary());
// FIXME: change tracking (MG)
- cur.paragraph().erase(cur.pos(), cur.buffer().params().trackChanges);
+ cur.paragraph().eraseChar(cur.pos(), cur.buffer().params().trackChanges);
}
if (cur.pos() == cur.lastpos())
spit += cur.pit();
Buffer & b = cur.buffer();
// FIXME: change tracking (MG)
- cur.paragraph().erase(cur.pos(), b.params().trackChanges);
+ cur.paragraph().eraseChar(cur.pos(), b.params().trackChanges);
if (!plist.empty()) {
pasteParagraphList(cur, plist, b.params().textclass,
b.errorList("Paste"));
Paragraph const & par = cur.paragraph();
std::ostringstream os;
- // FIXME: change tracking (MG)
- bool const show_change = par.lookupChange(cur.pos()) != Change(Change::UNCHANGED);
-
if (buf.params().trackChanges)
os << "[C] ";
- if (show_change) {
- Change change = par.lookupChange(cur.pos());
+ Change change = par.lookupChange(cur.pos());
+
+ if (change.type != Change::UNCHANGED) {
Author const & a = buf.params().authors().get(change.author);
os << to_utf8(_("Change: ")) << a.name();
if (!a.email().empty())
// for captions, we want the abbreviation of the float type
if (layout->labeltype == LABEL_SENSITIVE) {
// Search for the first float or wrap inset in the iterator
- size_t i = cur.depth();
- while (i > 0) {
- --i;
+ for (int i = cur.depth(); --i >= 0; ) {
InsetBase * const in = &cur[i].inset();
if (in->lyxCode() == InsetBase::FLOAT_CODE
|| in->lyxCode() == InsetBase::WRAP_CODE) {
- name = in->getInsetName();
+ name = to_utf8(in->getInsetName());
break;
}
}