]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTOC.cpp
Cocoa based Qt-4.6 needs to paint every character separately to match metrics computa...
[lyx.git] / src / insets / InsetTOC.cpp
index 7c7fa7c454279272d4b9b053d7de740fa6b8f8c1..bac2f43699b27c9aa5dd92656ab4aabfa3bea2d6 100644 (file)
@@ -110,11 +110,8 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
        xs << html::StartTag("div", "class='toc'");
 
        // Title of TOC
-       Language const * lang = buffer().params().language;
        static string toctitle = N_("Table of Contents");
-       docstring title = lang 
-                       ? translateIfPossible(from_ascii(toctitle), lang->code())
-                       : translateIfPossible(from_ascii(toctitle));
+       docstring title = buffer().B_(toctitle);
        xs << html::StartTag("div", tocattr)
                 << title
                 << html::EndTag("div");
@@ -162,6 +159,10 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
                
                // Now output TOC info for this entry
                Paragraph const & par = it->dit().innerParagraph();
+
+               string const attr = "href='#" + par.magicLabel() + "' class='tocentry'";
+               xs << html::StartTag("a", attr);
+
                // First the label, if there is one
                docstring const & label = par.params().labelString();
                if (!label.empty())
@@ -171,7 +172,9 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
                ours.for_toc = true;
                Font const dummy;
                par.simpleLyXHTMLOnePar(buffer(), xs, ours, dummy);
-               xs << " ";
+
+               xs << html::EndTag("a") << " ";
+
                // Now a link to that paragraph
                string const parattr = "href='#" + par.magicLabel() + "' class='tocarrow'";
                xs << html::StartTag("a", parattr);