From 7c38391754f14b5c76324d1e60e36d73525d3e1c Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 11 Feb 2008 13:06:01 +0000 Subject: [PATCH] Add list of notes and list of footnotes to the outline pane. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22942 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiToc.cpp | 6 ++++++ src/insets/InsetFoot.cpp | 13 +++++++++++++ src/insets/InsetFoot.h | 2 ++ src/insets/InsetNote.cpp | 14 ++++++++++++++ src/insets/InsetNote.h | 2 ++ 5 files changed, 37 insertions(+) diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp index 41d78877fe..2d746d80c1 100644 --- a/src/frontends/qt4/GuiToc.cpp +++ b/src/frontends/qt4/GuiToc.cpp @@ -221,6 +221,12 @@ docstring GuiToc::guiName(string const & type) const if (type == "tableofcontents") return _("Table of Contents"); + if (type == "footnote") + return _("List of Foot notes"); + + if (type == "note") + return _("List of Notes"); + FloatList const & floats = buffer().params().getTextClass().floats(); if (floats.typeExist(type)) return _(floats.getType(type).listName()); diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp index 4499860419..fe26f80870 100644 --- a/src/insets/InsetFoot.cpp +++ b/src/insets/InsetFoot.cpp @@ -24,6 +24,7 @@ #include "OutputParams.h" #include "ParIterator.h" #include "TextClass.h" +#include "TocBackend.h" #include "support/lstrings.h" @@ -74,6 +75,18 @@ void InsetFoot::updateLabels(Buffer const & buf, ParIterator const & it) } +void InsetFoot::addToToc(TocList & toclist, Buffer const & buf, ParConstIterator const &) const +{ + ParConstIterator pit = par_const_iterator_begin(*this); + + Toc & toc = toclist["footnote"]; + // FIXME: we probably want the footnote number too. + docstring str; + str = getNewLabel(str); + toc.push_back(TocItem(pit, 0, str)); +} + + int InsetFoot::latex(Buffer const & buf, odocstream & os, OutputParams const & runparams_in) const { diff --git a/src/insets/InsetFoot.h b/src/insets/InsetFoot.h index 172efd6e06..fef076035c 100644 --- a/src/insets/InsetFoot.h +++ b/src/insets/InsetFoot.h @@ -42,6 +42,8 @@ public: virtual docstring const editMessage() const; /// Update the counters of this inset and of its contents void updateLabels(Buffer const &, ParIterator const &); + /// + void addToToc(TocList &, Buffer const &, ParConstIterator const &) const; protected: InsetFoot(InsetFoot const &); diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 94463a64de..dc57f5ffff 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -30,7 +30,9 @@ #include "Lexer.h" #include "MetricsInfo.h" #include "OutputParams.h" +#include "ParIterator.h" #include "TextClass.h" +#include "TocBackend.h" #include "support/docstream.h" #include "support/Translator.h" @@ -218,6 +220,18 @@ void InsetNote::updateLabels(Buffer const & buf, ParIterator const & it) } +void InsetNote::addToToc(TocList & toclist, Buffer const & buf, ParConstIterator const &) const +{ + ParConstIterator pit = par_const_iterator_begin(*this); + + Toc & toc = toclist["note"]; + // FIXME: we probably want the note type too. + docstring str; + str = getNewLabel(str); + toc.push_back(TocItem(pit, 0, str)); +} + + bool InsetNote::isMacroScope(Buffer const & buf) const { // LyX note has no latex output diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index 1d51ee74d1..911c33355f 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -77,6 +77,8 @@ public: bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; // Update the counters of this inset and of its contents virtual void updateLabels(Buffer const &, ParIterator const &); + /// + void addToToc(TocList &, Buffer const &, ParConstIterator const &) const; protected: InsetNote(InsetNote const &); /// -- 2.39.2