]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetBibitem.cpp
Move the lyx::biblio namespace into src/. Also make changes to how the BibTeX
[features.git] / src / insets / InsetBibitem.cpp
index b315608498b858b20eff3e62bd456e021285c195..166bcdd5a84c27d0e0ab0c9e1887b0198b958673 100644 (file)
 
 #include "InsetBibitem.h"
 
+#include "Biblio.h"
 #include "Buffer.h"
 #include "BufferView.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "Font.h"
+#include "InsetIterator.h"
 #include "Lexer.h"
 #include "Paragraph.h"
 #include "ParagraphList.h"
@@ -184,4 +186,17 @@ docstring const bibitemWidest(Buffer const & buffer)
 }
 
 
+void InsetBibitem::fillWithBibKeys(Buffer const & buf,
+       std::vector<std::pair<std::string, docstring> > & keys,
+       InsetIterator const & it) const
+{
+       string const key = to_utf8(getParam("key"));
+       docstring const label = getParam("label");
+       DocIterator doc_it(it); 
+       doc_it.forwardPos();
+       docstring const ref = doc_it.paragraph().asString(buf, false);
+       docstring const info = label + biblio::TheBibliographyRef + ref;
+       keys.push_back(std::pair<string, docstring>(key, info));
+}
+
 } // namespace lyx