mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 06:19:36 +00:00
Minor code re-organization
This commit is contained in:
parent
d01dd54bf1
commit
ab63e72fcb
@ -672,23 +672,23 @@ void InsetCollapsible::addToToc(DocIterator const & cpit, bool output_active,
|
||||
{
|
||||
bool doing_output = output_active && producesOutput();
|
||||
InsetLayout const & layout = getLayout();
|
||||
if (layout.addToToc()) {
|
||||
TocBuilder & b = backend.builder(layout.tocType());
|
||||
// Cursor inside the inset
|
||||
DocIterator pit = cpit;
|
||||
pit.push_back(CursorSlice(const_cast<InsetCollapsible &>(*this)));
|
||||
docstring const label = getLabel();
|
||||
b.pushItem(pit, label + (label.empty() ? "" : ": "), output_active);
|
||||
// Proceed with the rest of the inset.
|
||||
InsetText::addToToc(cpit, doing_output, utype, backend);
|
||||
if (layout.isTocCaption()) {
|
||||
docstring str;
|
||||
text().forOutliner(str, TOC_ENTRY_LENGTH);
|
||||
b.argumentItem(str);
|
||||
}
|
||||
b.pop();
|
||||
} else
|
||||
InsetText::addToToc(cpit, doing_output, utype, backend);
|
||||
if (!layout.addToToc())
|
||||
return InsetText::addToToc(cpit, doing_output, utype, backend);
|
||||
|
||||
TocBuilder & b = backend.builder(layout.tocType());
|
||||
// Cursor inside the inset
|
||||
DocIterator pit = cpit;
|
||||
pit.push_back(CursorSlice(const_cast<InsetCollapsible &>(*this)));
|
||||
docstring const label = getLabel();
|
||||
b.pushItem(pit, label + (label.empty() ? "" : ": "), output_active);
|
||||
// Proceed with the rest of the inset.
|
||||
InsetText::addToToc(cpit, doing_output, utype, backend);
|
||||
if (layout.isTocCaption()) {
|
||||
docstring str;
|
||||
text().forOutliner(str, TOC_ENTRY_LENGTH);
|
||||
b.argumentItem(str);
|
||||
}
|
||||
b.pop();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user