- toc.push_back(TocItem(cpit, 0, screen_label_));
- return;
- }
- toc.push_back(TocItem(cpit, 0, screen_label_));
- Buffer::References const & refs = buffer().references(label);
- Buffer::References::const_iterator it = refs.begin();
- Buffer::References::const_iterator end = refs.end();
- for (; it != end; ++it) {
- DocIterator const ref_pit(it->second);
- if (it->first->lyxCode() == MATH_REF_CODE)
- toc.push_back(TocItem(ref_pit, 1,
- static_cast<InsetMathHull *>(it->first)->asRefInset()
- ->screenLabel()));
- else
- toc.push_back(TocItem(ref_pit, 1,
- static_cast<InsetRef *>(it->first)->screenLabel()));
+ toc->push_back(TocItem(cpit, 0, screen_label_, output_active));
+ } else {
+ toc->push_back(TocItem(cpit, 0, screen_label_, output_active));
+ for (auto const & p : buffer().references(label)) {
+ DocIterator const ref_pit(p.second);
+ if (p.first->lyxCode() == MATH_REF_CODE)
+ toc->push_back(TocItem(ref_pit, 1,
+ p.first->asInsetMath()->asRefInset()->screenLabel(),
+ output_active));
+ else
+ toc->push_back(TocItem(ref_pit, 1,
+ static_cast<InsetRef *>(p.first)->getTOCString(),
+ output_active));
+ }