]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCitation.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetCitation.cpp
index 8c97550ae188da5d7c923382ed933c4ea41daa84..26e0fe49046ef535bfec6853069769a0d012cdeb 100644 (file)
@@ -18,7 +18,6 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "DispatchResult.h"
-#include "FuncRequest.h"
 #include "LaTeXFeatures.h"
 #include "output_xhtml.h"
 #include "ParIterator.h"
@@ -41,7 +40,7 @@ ParamInfo InsetCitation::param_info_;
 
 
 InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
-       : InsetCommand(buf, p, "citation")
+       : InsetCommand(buf, p)
 {}
 
 
@@ -119,7 +118,7 @@ docstring InsetCitation::toolTip(BufferView const & bv, int, int) const
        vector<docstring>::const_iterator en = keys.end();
        docstring tip;
        for (; it != en; ++it) {
-               docstring const key_info = bi.getInfo(*it);
+               docstring const key_info = bi.getInfo(*it, buffer());
                if (key_info.empty())
                        continue;
                if (!tip.empty())
@@ -456,7 +455,7 @@ docstring InsetCitation::screenLabel() const
 }
 
 
-void InsetCitation::updateLabels(ParIterator const &, UpdateType)
+void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
 {
        CiteEngine const engine = buffer().params().citeEngine();
        if (cache.params == params() && cache.engine == engine)
@@ -469,7 +468,7 @@ void InsetCitation::updateLabels(ParIterator const &, UpdateType)
 
        docstring label = glabel;
        if (label.size() > maxLabelChars) {
-               label.erase(maxLabelChars-3);
+               label.erase(maxLabelChars - 3);
                label += "...";
        }
 
@@ -482,8 +481,13 @@ void InsetCitation::updateLabels(ParIterator const &, UpdateType)
 
 void InsetCitation::addToToc(DocIterator const & cpit)
 {
+       // NOTE
+       // XHTML output uses the TOC to collect the citations
+       // from the document. So if this gets changed, then we
+       // 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, getParam("key")));
+       toc.push_back(TocItem(cpit, 0, tocitem));
 }