[LyX/master] Add active refs to non-active labels to brokenrefs toc

Juergen Spitzmueller spitz at lyx.org
Sat Mar 14 14:16:39 UTC 2020


commit 0f9ef6877c8e590ae4b04bf009f8c50eb9a8e103
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Mar 14 15:35:47 2020 +0100

    Add active refs to non-active labels to brokenrefs toc
---
 src/insets/InsetRef.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index 2c4b7c2..b7a85fe 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<Toc> 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> toc = backend.toc("label");


More information about the lyx-cvs mailing list