#include "LyXAction.h"
#include "paragraph.h"
#include "insets/insetfloat.h"
+#include "insets/insetwrap.h"
#include "debug.h"
+#include "iterators.h"
using std::vector;
using std::max;
TocList toclist;
if (!buf)
return toclist;
- Paragraph * par = &*(buf->paragraphs.begin());
LyXTextClass const & textclass = buf->params.getLyXTextClass();
- while (par) {
+ ParConstIterator pit = buf->par_iterator_begin();
+ ParConstIterator end = buf->par_iterator_end();
+ for (; pit != end; ++pit) {
+ Paragraph const * par = *pit;
+
#ifdef WITH_WARNINGS
#warning bogus type (Lgb)
#endif
}
// For each paragraph, traverse its insets and look for
- // FLOAT_CODE
+ // FLOAT_CODE or WRAP_CODE
InsetList::iterator it = par->insetlist.begin();
InsetList::iterator end = par->insetlist.end();
for (; it != end; ++it) {
InsetFloat * il =
static_cast<InsetFloat*>(it.getInset());
il->addToToc(toclist, buf);
+ } else if (it.getInset()->lyxCode() == Inset::WRAP_CODE) {
+ InsetWrap * il =
+ static_cast<InsetWrap*>(it.getInset());
+ il->addToToc(toclist, buf);
}
}
-
- par = par->next();
}
return toclist;
}