On Sun, Feb 06, 2005 at 03:55:16AM +0100, Lars Gullik Bjønnes wrote:
> 
> void leaveInset(LCursor & cur, InsetBase const & in)
> {
>         for (size_t i = 0; i != cur.depth(); ++i) {
>                 if (&cur[i].inset() == &in) {
>                         cur.resize(i);
>                         return;
>                 }
>         }
> }
> 
> 
> Used here f.ex.
> 
> And LCursor::resize really is std::vector<CursorSlice>::resize, I am 
> perplexed...
> 
> When is it ever interesting to resize a LCursor?

When something serious happened to the structure above the current
cursor level.

Say, you are in a frac in a sqrt in an array and call 'delete row'.
The array will handle the request and completely destroy the sqrt and
frac, so the cursor must be moved out to some safe position, in this
case into the array.
 
> It seems to me that this is just a very funny way of writing erase.

It sort of is, but the criterion how many items are erased is given by
the inset argument.

Andre'

Reply via email to