]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetIndex.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetIndex.cpp
index 9a41978d9b31f476794af4f91a83d99d221306f4..e46e6cea8016168a921ddad2c26523f53ba7f0a1 100644 (file)
 
 #include "InsetIndex.h"
 
+#include "Buffer.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
 #include "sgml.h"
+#include "TocBackend.h"
+
+#include "support/gettext.h"
 
 #include <ostream>
 
@@ -59,6 +62,19 @@ void InsetIndex::write(Buffer const & buf, ostream & os) const
 }
 
 
+void InsetIndex::addToToc(Buffer const & buf,
+       ParConstIterator const & cpit) const
+{
+       ParConstIterator pit = cpit;
+       pit.push_back(*this);
+
+       Toc & toc = buf.tocBackend().toc("index");
+       docstring str;
+       str = getNewLabel(str);
+       toc.push_back(TocItem(pit, 0, str));
+}
+
+
 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
        : InsetCommand(p, string())
 {}
@@ -90,5 +106,4 @@ InsetCode InsetPrintIndex::lyxCode() const
        return INDEX_PRINT_CODE;
 }
 
-
 } // namespace lyx