On Mon, 3 Dec 2001, Juergen Vigna wrote: > > I don't think so. An inset does not know which inset contains it. > > Nope! It knows about it as we have Inset * Inset::owner() which returns > 0 for top-level-insets and the containing insets for insets down the tree. > But this has nothing to do with theLockingInset-mechanism!
This relience on having 0 returned by owner() could be avoided with Andre's cursor stack. The cursor knows exactly how it got to where it is. We avoid the need to manage the setting of owner_ and thereby reduce the possibilities for stuff-ups -- remember that owner_ needs to be updated or set any time we cut/paste/copy/merge an inset. A stack-based cursor would be a simple thing to implement and manage (std::stack?). Then we should only need to use the same two cursors to do anything. The second one only needed for selections. Allan. (ARRae)