]> git.lyx.org Git - features.git/commitdiff
Add list of numbered equations.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 15 Feb 2008 08:09:35 +0000 (08:09 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 15 Feb 2008 08:09:35 +0000 (08:09 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23013 a592a061-630c-0410-9148-cb99ea01b6c8

src/MenuBackend.cpp
src/frontends/qt4/GuiToc.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathHull.h

index 6dfdafb18759e0087b32cd4983756f7947dcca7f..c9e5a2572c4930db556ea08962034b0fa4d4f7b3 100644 (file)
@@ -768,6 +768,8 @@ void expandToc(Menu & tomenu, Buffer const * buf)
                        label = _(floatName);
                // BUG3633: listings is not a proper float so its name
                // is not shown in floatlist.
+               else if (cit->first == "equation")
+                       label = _("List of Equations");
                else if (cit->first == "index")
                        label = _("List of Indexes");
                else if (cit->first == "listing")
index 91d64f8ad1c18e5c39e23756a8a387c08428ee03..1fa29ef054f00ae6e4b5719165e7369b3555848c 100644 (file)
@@ -227,6 +227,8 @@ docstring GuiToc::guiName(string const & type) const
 {
        if (type == "tableofcontents")
                return _("Table of Contents");
+       if (type == "equation")
+               return _("List of Equations");
        if (type == "footnote")
                return _("List of Foot notes");
        if (type == "listing")
index 976b4865cf2f28a88186fded7b75e0f03fa18697..031dec39c33018ccc36349b9294ee0897cf342ba 100644 (file)
 #include "support/gettext.h"
 #include "LyXRC.h"
 #include "OutputParams.h"
+#include "ParIterator.h"
 #include "sgml.h"
 #include "Text.h"
 #include "TextPainter.h"
+#include "TocBackend.h"
 
 #include "insets/RenderPreview.h"
 #include "insets/InsetLabel.h"
@@ -192,6 +194,19 @@ InsetMathHull & InsetMathHull::operator=(InsetMathHull const & other)
 }
 
 
+void InsetMathHull::addToToc(TocList & toclist, Buffer const & buf,
+       ParConstIterator const & pit) const
+{
+       vector<docstring> labels;
+       getLabelList(buf, labels);
+       if (labels.empty())
+               return;
+
+       Toc & toc = toclist["equation"];
+       toc.push_back(TocItem(pit, 0, labels[0]));
+}
+
+
 Inset * InsetMathHull::editXY(Cursor & cur, int x, int y)
 {
        if (use_preview_) {
index 7e67c6e52f1cb4b1144047f2fd7912d656caee04..1cf09c344229a5344dd9c4b475fd7864fc598f1b 100644 (file)
 #define MATH_HULLINSET_H
 
 #include "InsetMathGrid.h"
+
 #include <boost/scoped_ptr.hpp>
 
 
 namespace lyx {
 
+class ParConstIterator;
 class RenderPreview;
 
 
@@ -31,6 +33,8 @@ public:
        ///
        ~InsetMathHull();
        ///
+       void addToToc(TocList &, Buffer const &, ParConstIterator const &) const;
+       ///
        InsetMathHull & operator=(InsetMathHull const &);
        ///
        mode_type currentMode() const;