* InsetXXX::addToToc(): properly use passed ParConstIterator.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23015 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-15 08:39:58 +00:00
parent 0a64dfa594
commit d8ee26ec6c
5 changed files with 19 additions and 11 deletions

View File

@ -75,9 +75,11 @@ void InsetFoot::updateLabels(Buffer const & buf, ParIterator const & it)
}
void InsetFoot::addToToc(TocList & toclist, Buffer const & buf, ParConstIterator const &) const
void InsetFoot::addToToc(TocList & toclist, Buffer const & buf,
ParConstIterator const & cpit) const
{
ParConstIterator pit = par_const_iterator_begin(*this);
ParConstIterator pit = cpit;
pit.push_back(*this);
Toc & toc = toclist["footnote"];
// FIXME: we probably want the footnote number too.

View File

@ -854,7 +854,7 @@ void InsetInclude::addPreview(graphics::PreviewLoader & ploader) const
void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer,
ParConstIterator const & pit) const
ParConstIterator const & cpit) const
{
if (isListings(params())) {
InsetListingsParams p(to_utf8(params()["lstparams"]));
@ -864,8 +864,8 @@ void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer,
Toc & toc = toclist["listing"];
docstring const str = convert<docstring>(toc.size() + 1)
+ ". " + from_utf8(caption);
// This inset does not have a valid ParConstIterator
// so it has to use the iterator of its parent paragraph
ParConstIterator pit = cpit;
pit.push_back(*this);
toc.push_back(TocItem(pit, 0, str));
return;
}

View File

@ -61,9 +61,11 @@ void InsetIndex::write(Buffer const & buf, ostream & os) const
}
void InsetIndex::addToToc(TocList & toclist, Buffer const & buf, ParConstIterator const &) const
void InsetIndex::addToToc(TocList & toclist, Buffer const & buf,
ParConstIterator const & cpit) const
{
ParConstIterator pit = par_const_iterator_begin(*this);
ParConstIterator pit = cpit;
pit.push_back(*this);
Toc & toc = toclist["index"];
docstring str;

View File

@ -79,9 +79,11 @@ int InsetMarginal::docbook(Buffer const & buf, odocstream & os,
}
void InsetMarginal::addToToc(TocList & toclist, Buffer const &/* buf*/, ParConstIterator const &) const
void InsetMarginal::addToToc(TocList & toclist, Buffer const &/* buf*/,
ParConstIterator const & cpit) const
{
ParConstIterator pit = par_const_iterator_begin(*this);
ParConstIterator pit = cpit;
pit.push_back(*this);
Toc & toc = toclist["marginalnote"];
docstring str;

View File

@ -220,9 +220,11 @@ void InsetNote::updateLabels(Buffer const & buf, ParIterator const & it)
}
void InsetNote::addToToc(TocList & toclist, Buffer const & /*buf*/, ParConstIterator const &) const
void InsetNote::addToToc(TocList & toclist, Buffer const & /*buf*/,
ParConstIterator const & cpit) const
{
ParConstIterator pit = par_const_iterator_begin(*this);
ParConstIterator pit = cpit;
pit.push_back(*this);
Toc & toc = toclist["note"];
docstring str;