From 410c716bf703dae98c2064d555b9e2b7678555ee Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 27 Mar 2013 18:40:08 -0400 Subject: [PATCH] Add Nomenclature to the TOC. --- src/frontends/qt4/qt_helpers.cpp | 2 ++ src/insets/InsetNomencl.cpp | 8 ++++++++ src/insets/InsetNomencl.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index 3aea0ebb4b..259696b5fc 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -582,6 +582,8 @@ QString guiName(string const & type, BufferParams const & bp) return qt_("List of Index Entries"); if (type == "marginalnote") return qt_("List of Marginal notes"); + if (type == "nomencl") + return qt_("Nomenclature Entries"); if (type == "note") return qt_("List of Notes"); if (type == "citation") diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index a3fe1bc4dc..6a02271612 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -30,6 +30,7 @@ #include "OutputParams.h" #include "output_xhtml.h" #include "sgml.h" +#include "TocBackend.h" #include "frontends/FontMetrics.h" @@ -130,6 +131,13 @@ void InsetNomencl::validate(LaTeXFeatures & features) const } +void InsetNomencl::addToToc(DocIterator const & cpit, bool output_active) const +{ + docstring const str = getParam("symbol"); + buffer().tocBackend().toc("nomencl").push_back(TocItem(cpit, 0, str, output_active)); +} + + ///////////////////////////////////////////////////////////////////// // // InsetPrintNomencl diff --git a/src/insets/InsetNomencl.h b/src/insets/InsetNomencl.h index 2a0eda957f..2e78c50290 100644 --- a/src/insets/InsetNomencl.h +++ b/src/insets/InsetNomencl.h @@ -40,6 +40,8 @@ public: /// Updates needed features for this inset. void validate(LaTeXFeatures & features) const; /// + void addToToc(DocIterator const & di, bool output_active) const; + /// InsetCode lyxCode() const { return NOMENCL_CODE; } /// int docbook(odocstream &, OutputParams const &) const; -- 2.39.5