From eb8468994f6ded648dcf6eaf957fa098ded6477c Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 13 Feb 2008 13:33:56 +0000 Subject: [PATCH] Add list of Marginal Notes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22976 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/MenuBackend.cpp | 2 ++ src/frontends/qt4/GuiToc.cpp | 7 ++++--- src/insets/InsetMarginal.cpp | 14 +++++++++++++- src/insets/InsetMarginal.h | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/MenuBackend.cpp b/src/MenuBackend.cpp index 5a1349418b..6dfdafb187 100644 --- a/src/MenuBackend.cpp +++ b/src/MenuBackend.cpp @@ -772,6 +772,8 @@ void expandToc(Menu & tomenu, Buffer const * buf) label = _("List of Indexes"); else if (cit->first == "listing") label = _("List of Listings"); + else if (cit->first == "marginalnote") + label = _("List of Marginal notes"); else if (cit->first == "note") label = _("List of Notes"); else if (cit->first == "footnote") diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp index d8dc337f38..91d64f8ad1 100644 --- a/src/frontends/qt4/GuiToc.cpp +++ b/src/frontends/qt4/GuiToc.cpp @@ -227,13 +227,14 @@ docstring GuiToc::guiName(string const & type) const { if (type == "tableofcontents") return _("Table of Contents"); - if (type == "footnote") return _("List of Foot notes"); - + if (type == "listing") + return _("List of Listings"); if (type == "index") return _("List of Indexes"); - + if (type == "marginalnote") + return _("List of Marginal notes"); if (type == "note") return _("List of Notes"); diff --git a/src/insets/InsetMarginal.cpp b/src/insets/InsetMarginal.cpp index 418ddad4f2..03e48e5fba 100644 --- a/src/insets/InsetMarginal.cpp +++ b/src/insets/InsetMarginal.cpp @@ -14,8 +14,10 @@ #include "InsetMarginal.h" #include "Buffer.h" -#include "support/gettext.h" #include "OutputParams.h" +#include "TocBackend.h" + +#include "support/gettext.h" #include @@ -77,4 +79,14 @@ int InsetMarginal::docbook(Buffer const & buf, odocstream & os, } +void InsetMarginal::addToToc(TocList & toclist, Buffer const & buf, ParConstIterator const &) const +{ + ParConstIterator pit = par_const_iterator_begin(*this); + + Toc & toc = toclist["marginalnote"]; + docstring str; + str = getNewLabel(str); + toc.push_back(TocItem(pit, 0, str)); +} + } // namespace lyx diff --git a/src/insets/InsetMarginal.h b/src/insets/InsetMarginal.h index 94f58a9f83..c081dd9b7b 100644 --- a/src/insets/InsetMarginal.h +++ b/src/insets/InsetMarginal.h @@ -41,6 +41,8 @@ public: OutputParams const & runparams) const; /// virtual docstring const editMessage() const; + /// + void addToToc(TocList &, Buffer const &, ParConstIterator const &) const; protected: InsetMarginal(InsetMarginal const &); private: