]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCitation.cpp
Fix wrongly copy-pasted entries in SpellcheckerUi.ui
[lyx.git] / src / insets / InsetCitation.cpp
index e6495e72abe2cefa7711559367c52d1af04b6291..7780f24a8d09c721b3cede8b6ac4fd1787ad68b9 100644 (file)
@@ -207,7 +207,8 @@ 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='#" + key + "'>" + html::htmlize(content) + "</a>";
+       return "<a href='#" + key + "'>" +
+                       html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
 }
 
 } // anonymous namespace
@@ -480,7 +481,7 @@ void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
 }
 
 
-void InsetCitation::addToToc(DocIterator const & cpit)
+void InsetCitation::addToToc(DocIterator const & cpit) const
 {
        // NOTE
        // XHTML output uses the TOC to collect the citations
@@ -533,23 +534,29 @@ docstring InsetCitation::xhtml(XHTMLStream & xs, OutputParams const &) const
                return docstring();
 
        // have to output this raw, because generateLabel() will include tags
-       xs << XHTMLStream::NextRaw() << generateLabel(true);
+       xs << XHTMLStream::ESCAPE_NONE << generateLabel(true);
 
        return docstring();
 }
 
 
-void InsetCitation::tocString(odocstream & os) const
+void InsetCitation::toString(odocstream & os) const
 {
        plaintext(os, OutputParams(0));
 }
 
 
+void InsetCitation::forToc(docstring & os, size_t) const
+{
+       os += screenLabel();
+}
+
+
 // Have to overwrite the default InsetCommand method in order to check that
 // the \cite command is valid. Eg, the user has natbib enabled, inputs some
 // citations and then changes his mind, turning natbib support off. The output
 // should revert to \cite[]{}
-int InsetCitation::latex(odocstream & os, OutputParams const & runparams) const
+void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
 {
        CiteEngine cite_engine = buffer().params().citeEngine();
        BiblioInfo const & bi = buffer().masterBibInfo();
@@ -577,8 +584,6 @@ int InsetCitation::latex(odocstream & os, OutputParams const & runparams) const
 
        if (runparams.inulemcmd)
                os << "}";
-
-       return 0;
 }
 
 
@@ -598,7 +603,7 @@ void InsetCitation::validate(LaTeXFeatures & features) const
 }
 
 
-docstring InsetCitation::contextMenu(BufferView const &, int, int) const
+docstring InsetCitation::contextMenuName() const
 {
        return from_ascii("context-citation");
 }