InsetArgument const * arginset = nullptr;
for (auto const & elem : par.insetList()) {
dit.pos() = elem.pos;
- elem.inset->addToToc(dit, doing_output, utype, backend);
- if (InsetArgument const * x = elem.inset->asInsetArgument())
- if (x->isTocCaption())
- arginset = x;
+ 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 (x->isTocCaption())
+ arginset = x;
+ }
}
// End custom AddToToc in paragraph layouts