This does not deal with the opposite case (caption inside minipage inside float) which is on bugzilla ?
OK ? john Index: buffer.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.h,v retrieving revision 1.116 diff -u -r1.116 buffer.h --- buffer.h 21 Oct 2002 16:21:52 -0000 1.116 +++ buffer.h 29 Oct 2002 21:56:07 -0000 @@ -400,9 +392,9 @@ } /// - ParIterator par_iterator_begin(); + ParIterator par_iterator_begin() const; /// - ParIterator par_iterator_end(); + ParIterator par_iterator_end() const; /// Inset * getInsetFromID(int id_arg) const; Index: buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.389 diff -u -r1.389 buffer.C --- buffer.C 21 Oct 2002 16:21:52 -0000 1.389 +++ buffer.C 29 Oct 2002 21:56:37 -0000 @@ -3332,13 +3303,13 @@ } -ParIterator Buffer::par_iterator_begin() +ParIterator Buffer::par_iterator_begin() const { return ParIterator(&*(paragraphs.begin())); } -ParIterator Buffer::par_iterator_end() +ParIterator Buffer::par_iterator_end() const { return ParIterator(); } Index: toc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/toc.C,v retrieving revision 1.12 diff -u -r1.12 toc.C --- toc.C 24 Sep 2002 18:36:19 -0000 1.12 +++ toc.C 29 Oct 2002 21:56:38 -0000 @@ -28,6 +28,7 @@ #include "insets/insetfloat.h" #include "insets/insetwrap.h" #include "debug.h" +#include "iterators.h" using std::vector; using std::max; @@ -72,11 +73,14 @@ TocList toclist; if (!buf) return toclist; - Paragraph * par = &*(buf->paragraphs.begin()); LyXTextClass const & textclass = buf->params.getLyXTextClass(); - while (par) { + ParIterator pit = buf->par_iterator_begin(); + ParIterator end = buf->par_iterator_end(); + for (; pit != end; ++pit) { + Paragraph * par = *pit; + #ifdef WITH_WARNINGS #warning bogus type (Lgb) #endif @@ -106,8 +110,6 @@ il->addToToc(toclist, buf); } } - - par = par->next(); } return toclist; } -- ""All the people we like are We, and everyone else is They." - Kipling