]> git.lyx.org Git - features.git/commitdiff
Add outliner section for broken refs and citations
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 14 Mar 2020 14:18:28 +0000 (15:18 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 14 Mar 2020 14:18:28 +0000 (15:18 +0100)
src/TocBackend.cpp
src/insets/InsetCitation.cpp
src/insets/InsetCommand.h
src/insets/InsetRef.cpp

index 7ea16b747a20b284fce31eb082c3e8bacde1799f..43a2188c713c15234b6b5d302c9f75c694cb16cd 100644 (file)
@@ -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"));
index f3d4d2a7e6d808fcf07321ce29f1a88bbaba8146..3fa824522417bb651abc0e9002b721db5feaa4d7 100644 (file)
@@ -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<Toc> toc2 = backend.toc("brokenrefs");
+               toc2->push_back(TocItem(cpit, 0, tocitem, output_active));
+       }
 }
 
 
index f959d19921b1a0ee5afbc4bd6add51510a5b1e91..58d2345841b7c25b194957da4edaa084eff6547f 100644 (file)
@@ -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
        //@{
index 8f12dbaa50e7e53290eb79195809c33406598ce5..2c4b7c2457f81c099a70dd7774c3e1d27ef265c3 100644 (file)
@@ -470,6 +470,8 @@ void InsetRef::addToToc(DocIterator const & cpit, bool output_active,
        setBroken(broken_);
        shared_ptr<Toc> toc = backend.toc("label");
        toc->push_back(TocItem(cpit, 0, screenLabel(), output_active));
+       shared_ptr<Toc> toc2 = backend.toc("brokenrefs");
+       toc2->push_back(TocItem(cpit, 0, screenLabel(), output_active));
 }