From: Juergen Spitzmueller Date: Sat, 14 Mar 2020 14:35:47 +0000 (+0100) Subject: Add active refs to non-active labels to brokenrefs toc X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=89463d4c04e17bc37598285d3de78a253308f93f;p=features.git Add active refs to non-active labels to brokenrefs toc --- diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index 2c4b7c2457..b7a85fe38d 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -454,18 +454,21 @@ docstring InsetRef::screenLabel() const void InsetRef::addToToc(DocIterator const & cpit, bool output_active, - UpdateType, TocBackend & backend) const + UpdateType, TocBackend & backend) const { docstring const & label = getParam("reference"); if (buffer().insetLabel(label)) { broken_ = !buffer().activeLabel(label); setBroken(broken_); + if (broken_ && output_active) { + shared_ptr toc2 = backend.toc("brokenrefs"); + toc2->push_back(TocItem(cpit, 0, screenLabel(), output_active)); + } // This InsetRef has already been taken care of in InsetLabel::addToToc(). return; } // It seems that this reference does not point to any valid label. - broken_ = true; setBroken(broken_); shared_ptr toc = backend.toc("label");