-void InsetFoot::addToToc(ParConstIterator const & cpit) const
-{
- ParConstIterator pit = cpit;
- pit.push_back(*this);
-
- Toc & toc = buffer().tocBackend().toc("footnote");
- // FIXME: we probably want the footnote number too.
- docstring str;
- str = getNewLabel(str);
- toc.push_back(TocItem(pit, 0, str));
+ Language const * lang = it.paragraph().getParLanguage(bp);
+ InsetLayout const & il = getLayout();
+ docstring const & count = il.counter();
+ custom_label_ = translateIfPossible(il.labelstring());
+ if (cnts.hasCounter(count))
+ cnts.step(count, utype);
+ custom_label_ += ' ' + cnts.theCounter(count, lang->code());
+ setLabel(custom_label_);
+
+ InsetCollapsible::updateBuffer(it, utype);
+ if (utype == OutputUpdate)
+ cnts.restoreLastCounter();