-
- Toc & toc = buffer().tocBackend().toc(floattype_);
- docstring str = full_label_;
- text().forToc(str, TOC_ENTRY_LENGTH);
- toc.push_back(TocItem(pit, 0, str, output_active));
-
+ int length = (utype == OutputUpdate) ?
+ // For output (e.g. xhtml) all (bug #8603) or nothing
+ (output_active ? INT_MAX : 0) :
+ // TOC for LyX interface
+ TOC_ENTRY_LENGTH;
+ docstring str;
+ if (length > 0) {
+ str = full_label_;
+ text().forOutliner(str, length);
+ }
+ backend.builder(type).captionItem(pit, str, output_active);