On Tue, May 22, 2007 at 02:10:04PM -0500, Bo Peng wrote:
> >> +             if (floatName != string())
> >
> >      if (!floatName.empty())
> 
> Thanks Andre, but do you know how to get the pit of an InsetInclude?

I am afraid I don't understand the question.

In most cases a variable 'pit' is an integer offset in the list of
paragraphs of the surrounding inset.

> 
> +                       // This *does not* work because pit is not a
> proper ParConstIterator
> +                       // at least pit->id() would crash lyx. Is this
> because InsetInclude
> +                       // is not derived from InsetText?
> +                       ParConstIterator pit = 
> par_const_iterator_begin(*this);

Ah.. ParConstIterator is more or less a thin wrapper around DocIterator
moving down a whole paragraph on each operator++() call.

Being derived from InsetText is not crucial, however, having a working

 Text * InsetFoo::getText(int index) 

is.  This usually means you need 'some kind of embedded Text
somewhere'...

Andre'

Reply via email to