Jean-Marc Lasgouttes schrieb:
I am sorry that I did not answer in time. To try to compensate, here
is a patch showing what I mean. The idea is to use the complete
symmetry between accept and reject:
- accept: remove DELETED chunks, keep INSERTED chunks
- reject: remove INSERTED chunks, keep DELETED chunks
Do you see better what I mean?
I see what you mean but actually I don't like your patch.
Your patch suggests that accept and reject are symmetric. However, they
are not in general! In method acceptOrRejectChanges(), your patch may
work but in Paragraph::pimpl - as you have found out by yourself -
accept and reject behave asymmetric. The difference is in the handling
of nested insets:
- If you accept an inserted inset, you also want to accept all of its
content.
- However, if you reject a deleted inset (i.e., you mark it as
unchanged again), you do not necessarily want to reject changes inside
the inset.
There is a note in rejectChanges():
// Do NOT reject changes within a deleted inset!
// There may be insertions of a co-author inside of it!
Imagine the case where you edit an inset. Afterwards you send the
document to your colleague, who decides to delete the complete inset.
When you receive his revised paper, you decide to reject his deletion.
However, you do not want to reject your own changes inside of the inset!
In case of accepting an inset, I think it makes sense to accept also its
content.
For this reason, I don't think that it is a good idea to apply your
patch, even if it doesn't hurt. It may trick future developers.
Jean-Marc, do you agree with my explanations?
Michael