(cherry picked from commit 61181a3977)
This commit is contained in:
Richard Kimberly Heck 2024-06-01 11:52:05 -04:00
parent 91e90a7c1c
commit b78bcc2eb2

View File

@ -1205,11 +1205,15 @@ void InsetText::iterateForToc(DocIterator const & cdit, bool output_active,
InsetArgument const * arginset = nullptr; InsetArgument const * arginset = nullptr;
for (auto const & elem : par.insetList()) { for (auto const & elem : par.insetList()) {
dit.pos() = elem.pos; dit.pos() = elem.pos;
elem.inset->addToToc(dit, doing_output, utype, backend); bool const being_output = doing_output &&
!par.lookupChange(elem.pos).deleted();
if (being_output) {
elem.inset->addToToc(dit, being_output, utype, backend);
if (InsetArgument const * x = elem.inset->asInsetArgument()) if (InsetArgument const * x = elem.inset->asInsetArgument())
if (x->isTocCaption()) if (x->isTocCaption())
arginset = x; arginset = x;
} }
}
// End custom AddToToc in paragraph layouts // End custom AddToToc in paragraph layouts
while (!addtotoc_stack.empty() && addtotoc_stack.top().second == pit) { while (!addtotoc_stack.empty() && addtotoc_stack.top().second == pit) {