]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.cpp
Change inset label from ": filename" to "Program Listing: filename" for listings...
[lyx.git] / src / insets / InsetBibitem.cpp
index ed9e859641352748ffe0657fc0b3c9a615710376..3978c60df861257961c435a79f473c4efbf9011f 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <config.h>
+#include <algorithm>
 
 #include "InsetBibitem.h"
 
@@ -34,8 +35,6 @@
 #include "support/gettext.h"
 #include "support/convert.h"
 
-#include <ostream>
-
 using namespace std;
 using namespace lyx::support;
 
@@ -65,9 +64,7 @@ void InsetBibitem::updateCommand(docstring const & new_key, bool)
        docstring const old_key = getParam("key");
        docstring key = new_key;
 
-       BiblioInfo keys;
-       keys.fillWithBibKeys(&buffer());
-       vector<docstring> bibkeys = keys.getKeys();
+       vector<docstring> bibkeys = buffer().masterBibInfo().getKeys();
 
        int i = 1;
 
@@ -105,7 +102,7 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p(BIBITEM_CODE);
-               InsetCommandMailer::string2params("bibitem", to_utf8(cmd.argument()), p);
+               InsetCommand::string2params("bibitem", to_utf8(cmd.argument()), p);
                if (p.getCmdName().empty()) {
                        cur.noUpdate();
                        break;
@@ -163,7 +160,7 @@ int InsetBibitem::plaintext(odocstream & os, OutputParams const &) const
 
 
 // ale070405
-docstring const bibitemWidest(Buffer const & buffer)
+docstring bibitemWidest(Buffer const & buffer)
 {
        int w = 0;
 
@@ -234,7 +231,7 @@ void InsetBibitem::fillWithBibKeys(BiblioInfo & keys, InsetIterator const & it)
        keyvalmap[from_ascii("label")] = getParam("label");
        DocIterator doc_it(it); 
        doc_it.forwardPos();
-       keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString(false);
+       keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString();
        keys[key] = keyvalmap;
 }