From ad6250f1a6701c28f3baa3591f60f6a3bdf52c22 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 27 Mar 2013 17:19:47 -0400 Subject: [PATCH] A little bit more cleaning up. --- src/insets/InsetTOC.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index a5d3d4cff8..950e373828 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -245,9 +245,9 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const return docstring(); } - Layout const & lay = buffer().params().documentClass().htmlTOCLayout(); - string const & tocclass = lay.defaultCSSClass(); - string const tocattr = "class='tochead " + tocclass + "'"; + Toc const & toc = buffer().tocBackend().toc(cmd2type(command)); + if (toc.empty()) + return docstring(); // we'll use our own stream, because we are going to defer everything. // that's how we deal with the fact that we're probably inside a standard @@ -255,14 +255,13 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const odocstringstream ods; XHTMLStream xs(ods); - Toc const & toc = buffer().tocBackend().toc(cmd2type(command)); - if (toc.empty()) - return docstring(); - xs << html::StartTag("div", "class='toc'"); // Title of TOC 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) << title << html::EndTag("div"); -- 2.39.2