On Thu, Aug 01, 2002 at 02:13:50PM +0100, Angus Leeming wrote:
> How should I loop over all insets? Do I:
> 
> 1. Loop from outside
>       for (; it != end; ++it) {
>               (*it)->addPreview(ploader);
>               // add some sub-loop
>       }
> 
> 2. Overload addPreview in container insets (text, tabular, collapsable any 
> more?)


Using iterators is much better than the 2nd method which is used a lot
in the current code.

Just create an InsetIterator in iterators.C.
An example implementation:

Class InsetIterator {
        ParIterator par;
        Paragraph::inset_iterator inset;
...
}

Reply via email to