]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTOC.cpp
Fix crash after undo following replacement of a multicell selection (#8973).
[lyx.git] / src / insets / InsetTOC.cpp
index 331153b94c829f97e62712cd569f4b01e4cac1d6..fc1f42bcae86ab8c3cb0d41e136d1e62bea65b48 100644 (file)
@@ -232,11 +232,10 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
        string const & command = getCmdName();
        if (command != "tableofcontents" && command != "lstlistoflistings") {
                LYXERR0("TOC type " << command << " not yet implemented.");
-               LASSERT(false, /* */);
-               return docstring();
+               LASSERT(false, return docstring());
        }
 
-       Toc const & toc = buffer().tocBackend().toc(cmd2type(command));
+       Toc const & toc = buffer().masterBuffer()->tocBackend().toc(cmd2type(command));
        if (toc.empty())
                return docstring();
 
@@ -249,13 +248,15 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
        xs << html::StartTag("div", "class='toc'");
 
        // Title of TOC
+       InsetLayout const & il = getLayout();
+       string const & tag = il.htmltag();
        docstring title = screenLabel();
        Layout const & lay = buffer().params().documentClass().htmlTOCLayout();
        string const & tocclass = lay.defaultCSSClass();
        string const tocattr = "class='tochead " + tocclass + "'";
-       xs << html::StartTag("div", tocattr)
+       xs << html::StartTag(tag, tocattr)
                 << title
-                << html::EndTag("div");
+                << html::EndTag(tag);
 
        // with lists of listings, at least, there is no depth
        // to worry about. so the code can be simpler.