fix 568 (r=lars)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5555 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-10-30 15:09:55 +00:00
parent aeafc7d616
commit eb2352f227
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2002-10-30 John Levon <levon@movementarian.org>
* insetfloat.C (addToTOC): recursively traverse all
contents looking for captions (fix #568)
2002-10-25 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2002-10-25 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* insetexternal.C (doSubstitution): do not try to replace * insetexternal.C (doSubstitution): do not try to replace

View File

@ -30,6 +30,7 @@
#include "frontends/LyXView.h" #include "frontends/LyXView.h"
#include "frontends/Dialogs.h" #include "frontends/Dialogs.h"
#include "lyxlex.h" #include "lyxlex.h"
#include "iterators.h"
using std::ostream; using std::ostream;
using std::endl; using std::endl;
@ -339,11 +340,13 @@ bool InsetFloat::wide() const
void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
{ {
// Now find the caption in the float... ParIterator pit(inset.paragraph());
// We now tranverse the paragraphs of ParIterator end;
// the inset...
Paragraph * tmp = inset.paragraph(); // Find a caption layout in one of the (child inset's) pars
while (tmp) { for (; pit != end; ++pit) {
Paragraph * tmp = *pit;
if (tmp->layout()->name() == caplayout) { if (tmp->layout()->name() == caplayout) {
string const str = string const str =
tostr(toclist[type()].size() + 1) tostr(toclist[type()].size() + 1)
@ -351,6 +354,5 @@ void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
toc::TocItem const item(tmp, 0 , str); toc::TocItem const item(tmp, 0 , str);
toclist[type()].push_back(item); toclist[type()].push_back(item);
} }
tmp = tmp->next();
} }
} }