Angus Leeming wrote:

> The problem appears to be caused by the fact that the inset is inside
> a minipage inside a float. Previews are generated when the buffer is
> loaded by this code in graphics/Previews.C:
> 
> void Previews::generateBufferPreviews(Buffer const & buffer) const
> {
>         PreviewLoader & ploader = loader(buffer);
> 
>         Buffer::inset_iterator it  = buffer.inset_const_iterator_begin();
>         Buffer::inset_iterator end = buffer.inset_const_iterator_end();
> 
>         for (; it != end; ++it)
>                 it->addPreview(ploader);
> 
>         ploader.startLoading();
> }
> 
> Ie, loop over all 'outermost' insets and call their addPreview member
> function. For collabsable insets such as float and minipage, this is
> simply
> 
> void InsetCollapsable::addPreview(PreviewLoader & loader) const
> {
>         inset.addPreview(loader);
> }
> 
> Ie, pass the call on to the InsetText member function:
> 
> void InsetText::addPreview(PreviewLoader & loader) const
> {
>         ParagraphList::const_iterator pit = paragraphs.begin();
>         ParagraphList::const_iterator pend = paragraphs.end();
> 
>         for (; pit != pend; ++pit) {
>                 InsetList::const_iterator it  = pit->insetlist.begin();
>                 InsetList::const_iterator end = pit->insetlist.end();
>                 for (; it != end; ++it)
>                         it->inset->addPreview(loader);
>         }
> }
> 
> My understanding is that ParagraphList::iterator loops over outermost
> insets only. Correct? 

I don't know, but in this case (inset inside minipage inside float) it seems
that the recursive call should work (all insets involved are inside some
ParagraphList) IIUC. So I don't see why does it fail.

> Anyway, I fail to see why this code will not lead to a scheme where insets
> within insets will be called naturally. 
> Could someone clued-in help me out here?

That would certainly not be me... [but: we have to decide for a consistent
scheme. André wants to have all insets inside Paragraph(List) inside inset
etc (the only nesting allowed) and not to have insets directly included
within insets (like: tables, previewed insets). I see some shortcomings of
this but in general having a consistent policy (even if not perfect) is
always better than to have none, and would certainly solve the
inset-traversal problem...]

Alfredo


Reply via email to