]> git.lyx.org Git - features.git/commitdiff
Add list of notes and list of footnotes to the outline pane.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 11 Feb 2008 13:06:01 +0000 (13:06 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 11 Feb 2008 13:06:01 +0000 (13:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22942 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToc.cpp
src/insets/InsetFoot.cpp
src/insets/InsetFoot.h
src/insets/InsetNote.cpp
src/insets/InsetNote.h

index 41d78877fe34f198220f2727859107e8b2164e6b..2d746d80c1ab98d9d8797776876d621f3d38ff7c 100644 (file)
@@ -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());
index 44998604198acb5413cf9e8d7716388e7c6bfa1c..fe26f80870feca35498d3c979863dde089abe4a1 100644 (file)
@@ -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
 {
index 172efd6e06d25bbb2ba98c2f270daecfeb3b0ec9..fef076035c5ba73568e6c54239b20b7470211b5f 100644 (file)
@@ -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 &);
index 94463a64decc44880a0602962359b269fca6cb39..dc57f5ffff7da8ef804a1bfe14354a61dd4a2fd4 100644 (file)
@@ -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
index 1d51ee74d18488186acdb830d5b09136b627b40a..911c33355f83ab20e90b403721178fab629b439b 100644 (file)
@@ -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 &);
        ///