From: Juergen Spitzmueller Date: Sat, 14 Mar 2020 14:18:28 +0000 (+0100) Subject: Add outliner section for broken refs and citations X-Git-Tag: lyx-2.4.0dev-acb2ca7b~1114 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a1da60642c0541b6ebac85dd8b64de8ff993c256;p=features.git Add outliner section for broken refs and citations --- diff --git a/src/TocBackend.cpp b/src/TocBackend.cpp index 7ea16b747a..43a2188c71 100644 --- a/src/TocBackend.cpp +++ b/src/TocBackend.cpp @@ -288,6 +288,7 @@ void TocBackend::resetOutlinerNames() addName("senseless", _("Senseless")); addName("citation", _("Citations")); addName("label", _("Labels and References")); + addName("brokenrefs", _("Broken References and Citations")); // Customizable, but the corresponding insets have no layout definition addName("child", _("Child Documents")); addName("graphics", _("Graphics")); diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index f3d4d2a7e6..3fa8245224 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -493,10 +493,17 @@ void InsetCitation::addToToc(DocIterator const & cpit, bool output_active, // from the document. It is used indirectly, via BiblioInfo::makeCitationLables, // by both XHTML and plaintext output. So, if we change what goes into the TOC, // then we will also need to change that routine. - docstring const tocitem = getParam("key"); + docstring tocitem; + if (isBroken()) + tocitem = _("BROKEN: "); + tocitem += getParam("key"); TocBuilder & b = backend.builder("citation"); b.pushItem(cpit, tocitem, output_active); b.pop(); + if (isBroken()) { + shared_ptr toc2 = backend.toc("brokenrefs"); + toc2->push_back(TocItem(cpit, 0, tocitem, output_active)); + } } diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index f959d19921..58d2345841 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -64,6 +64,8 @@ public: docstring const getFirstNonOptParam() const { return p_.getFirstNonOptParam(); } /// void setBroken(bool const b) const { broken_ = b; } + /// + bool isBroken() const { return broken_; } /// \name Public functions inherited from Inset class //@{ diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index 8f12dbaa50..2c4b7c2457 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -470,6 +470,8 @@ void InsetRef::addToToc(DocIterator const & cpit, bool output_active, setBroken(broken_); shared_ptr toc = backend.toc("label"); toc->push_back(TocItem(cpit, 0, screenLabel(), output_active)); + shared_ptr toc2 = backend.toc("brokenrefs"); + toc2->push_back(TocItem(cpit, 0, screenLabel(), output_active)); }