A little bit more cleaning up.

This commit is contained in:
Richard Heck 2013-03-27 17:19:47 -04:00
parent 2d34e48869
commit ad6250f1a6

View File

@ -245,9 +245,9 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
return docstring(); return docstring();
} }
Layout const & lay = buffer().params().documentClass().htmlTOCLayout(); Toc const & toc = buffer().tocBackend().toc(cmd2type(command));
string const & tocclass = lay.defaultCSSClass(); if (toc.empty())
string const tocattr = "class='tochead " + tocclass + "'"; return docstring();
// we'll use our own stream, because we are going to defer everything. // 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 // 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; odocstringstream ods;
XHTMLStream xs(ods); XHTMLStream xs(ods);
Toc const & toc = buffer().tocBackend().toc(cmd2type(command));
if (toc.empty())
return docstring();
xs << html::StartTag("div", "class='toc'"); xs << html::StartTag("div", "class='toc'");
// Title of TOC // Title of TOC
docstring title = screenLabel(); 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("div", tocattr)
<< title << title
<< html::EndTag("div"); << html::EndTag("div");