On Tue, 27 May 2003, Andre Poenitz wrote: > But we would need to be careful nevertheless as in some cases we would > still have to invalidate iterators (i.e. when the underlying paragraph is > removed). > > So in e.g. undo we'd better not remove the changed par from the list and > re-insert a copy of an old one as this invalidates all iterators pointing > to that paragraph and we might be interested in keeping a few of them > alive...
I see what you mean. When a paragraph is removed, and thus moved to undo stack, the iterators for error insets, cursors, and bookmarks in those affected paragraphs surely should invalidate in the document. But when you then "undo", you want to restore the iterators. For this to work, you need to move all the "old" iterators into your undo-structure, and when you undo, restore all of these as well. (Alternatively, you can choose to accept that iterators might break across the undo barrier, although that's not too great.) In other words, it's logical to let all iterators be part of the data structure itself as well. Regards, Asger