]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTOC.cpp
Make undo action no-ops when the buffer is read-only
[lyx.git] / src / insets / InsetTOC.cpp
index a3739d74f51a4deb52de231c760e1c0b3cbd8b9e..a429d2d5bcf1326493016c812e983b22e413cf91 100644 (file)
@@ -21,7 +21,6 @@
 #include "FuncRequest.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
-#include "OutputParams.h"
 #include "output_xhtml.h"
 #include "Paragraph.h"
 #include "ParagraphParameters.h"
@@ -29,6 +28,7 @@
 #include "TocBackend.h"
 
 #include "support/debug.h"
+#include "support/docstream.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
 
@@ -128,11 +128,10 @@ int InsetTOC::plaintext(odocstringstream & os,
 }
 
 
-int InsetTOC::docbook(odocstream & os, OutputParams const &) const
+void InsetTOC::docbook(XMLStream &, OutputParams const &) const
 {
-       if (getCmdName() == "tableofcontents")
-               os << "<toc></toc>";
-       return 0;
+       // TOC are generated automatically by the DocBook processor.
+       return;
 }
 
 
@@ -169,7 +168,7 @@ void InsetTOC::makeTOCWithDepth(XMLStream & xs,
                        continue;
 
                // First, we need to manage increases and decreases of depth
-               // If there's no depth to deal with, we artifically set it to 1.
+               // If there's no depth to deal with, we artificially set it to 1.
                int const depth = it->depth();
 
                // Ignore stuff above the tocdepth