]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCitation.cpp
Fix empty width support for Box inset
[lyx.git] / src / insets / InsetCitation.cpp
index 60e3bbe0fc475be150d7423f869fd0c2e89e8b15..c0e61798a8fecda40ed999b9d0091ff0020f4841 100644 (file)
@@ -221,7 +221,7 @@ inline docstring wrapCitation(docstring const & key,
                return content;
        // we have to do the escaping here, because we will ultimately
        // write this as a raw string, so as not to escape the tags.
-       return "<a href='#LyXCite-" + key + "'>" +
+       return "<a href='#LyXCite-" + html::cleanAttr(key) + "'>" +
                        html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
 }
 
@@ -330,7 +330,7 @@ void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
 }
 
 
-void InsetCitation::addToToc(DocIterator const & cpit) const
+void InsetCitation::addToToc(DocIterator const & cpit, bool output_active) const
 {
        // NOTE
        // XHTML output uses the TOC to collect the citations
@@ -338,11 +338,12 @@ void InsetCitation::addToToc(DocIterator const & cpit) const
        // will need to change how the citations are collected.
        docstring const tocitem = getParam("key");
        Toc & toc = buffer().tocBackend().toc("citation");
-       toc.push_back(TocItem(cpit, 0, tocitem));
+       toc.push_back(TocItem(cpit, 0, tocitem, output_active));
 }
 
 
-int InsetCitation::plaintext(odocstream & os, OutputParams const &) const
+int InsetCitation::plaintext(odocstringstream & os,
+       OutputParams const &, size_t) const
 {
        string const & cmd = getCmdName();
        if (cmd == "nocite")
@@ -396,7 +397,9 @@ docstring InsetCitation::xhtml(XHTMLStream & xs, OutputParams const &) const
 
 void InsetCitation::toString(odocstream & os) const
 {
-       plaintext(os, OutputParams(0));
+       odocstringstream ods;
+       plaintext(ods, OutputParams(0));
+       os << ods.str();
 }