On Friday 02 August 2002 12:50 pm, Dekel Tsur wrote: > 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; > ... > }
Thanks, Dekel. However... I think I've come to the opposite conclusion. If we overload addPreview then things like tables could generate a preview of the entire table if they so desired. Note that I only think I've come to this conclusion. I'll continue to think about it. Angus