[EMAIL PROTECTED] writes:

> +docstring InsetFloat::getCaptionText(OutputParams const & runparams) const
> +{
> +     if (paragraphs().empty())
> +             return docstring();
> +
> +     ParagraphList::const_iterator pit = paragraphs().begin();
> +     for (; pit != paragraphs().end(); ++pit) {
> +             InsetList::const_iterator it = pit->insetList().begin();
> +             for (; it != pit->insetList().end(); ++it) {
> +                     Inset & inset = *it->inset;
> +                     if (inset.lyxCode() == CAPTION_CODE) {
> +                             odocstringstream ods;
> +                             InsetCaption * ins =
> +                                     static_cast<InsetCaption *>(it->inset);
> +                             ins->getCaptionText(ods, runparams);
> +                             return ods.str();
> +                     }
> +             }
> +     }
> +     return docstring();
> +}
> +
> +

Instead of reinventing the wheel, it looks like you should move
findInset from BufferView.cpp to a place where other code can use it
and then use it with a DocIterator that initially contains only the
Float inset as a slice.

JMarc

Reply via email to