docstring const & TocItem::tooltip() const
{
- return tooltip_;
+ return tooltip_.empty() ? str_ : tooltip_;
}
bool TocBackend::updateItem(DocIterator const & dit)
{
- if (dit.paragraph().layout().toclevel == Layout::NOT_IN_TOC)
+ if (dit.text()->getTocLevel(dit.pit()) == Layout::NOT_IN_TOC)
return false;
if (toc("tableofcontents").empty()) {
*static_cast<InsetArgument&>(inset).paragraphs().begin();
if (!par.labelString().empty())
tocstring = par.labelString() + ' ';
- tocstring += inset_par.asString(AS_STR_INSETS | AS_STR_INTOC);
+ tocstring += inset_par.asString(AS_STR_INSETS);
break;
}
}
- int const toclevel = par.layout().toclevel;
+ int const toclevel = toc_item->dit_.text()->getTocLevel(toc_item->dit_.pit());
if (toclevel != Layout::NOT_IN_TOC && toclevel >= min_toclevel
&& tocstring.empty())
- tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS | AS_STR_INTOC);
+ tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
const_cast<TocItem &>(*toc_item).str_ = tocstring;