Angus Leeming wrote:

> Angus Leeming wrote:
> 
>> Alfredo Braunstein wrote:
>>>> We could add a bool DocumentIterator::contains(inset *) that
>>>> checks the stack for that particular inset. then
>>>> 
>>>> +                                       if (cur.contains(&*it))
>>>> +                                               cur.pop();
>>> 
>>> ... and cur.pop is no good either. we need to cut it to the level
>>> in which the inset is found.
>>> 
>>> What do you
>> 
>> Agreed. However, I don't know how to do that.
> 
> Actually, what we want is to iterate from the 'innermost' inset to the
> 'outermost'. Eg, if this is our structure:
> 
> [A: [B: ] [C: [D: ]] [E: ]] [F: ]
> 
> A contains B, C, E.
> C contains D.
> A and F are on the same level.
> 
> We want to iterate:
> A B D C E F
> 
> Can we do that?

You mean BDCEAF ?

Yes, that would be a way to solve the problem. It shouldn't be too hard
methinks. I'll think about it tonight.

Alfredo


Reply via email to