]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetBibitem.cpp
index 50e1cb1c8a33e0804c3d0a2c27302fcaa2056e83..3a6f083cb065489a3ed1a488c2698c02fa2ab0c7 100644 (file)
 #include "Lexer.h"
 #include "Paragraph.h"
 #include "ParagraphList.h"
+#include "TextClass.h"
 
 #include "support/lstrings.h"
-#include "support/std_ostream.h"
+#include "support/docstream.h"
 #include "support/convert.h"
 
+#include <ostream>
+
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -46,7 +51,7 @@ InsetBibitem::InsetBibitem(InsetCommandParams const & p)
 }
 
 
-CommandInfo const * InsetBibitem::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetBibitem::findInfo(string const & /* cmdName */)
 {
        static const char * const paramnames[] = {"label", "key", ""};
        static const bool isoptional[] = {true, false};
@@ -91,9 +96,9 @@ void InsetBibitem::read(Buffer const & buf, Lexer & lex)
 {
        InsetCommand::read(buf, lex);
 
-       if (support::prefixIs(getParam("key"), key_prefix)) {
+       if (prefixIs(getParam("key"), key_prefix)) {
                int const key = convert<int>(getParam("key").substr(key_prefix.length()));
-               key_counter = std::max(key_counter, key);
+               key_counter = max(key_counter, key);
        }
 }
 
@@ -193,12 +198,11 @@ void InsetBibitem::fillWithBibKeys(Buffer const & buf,
        BiblioInfo & keys, InsetIterator const & it) const
 {
        docstring const key = getParam("key");
-       BibTeXInfo keyvalmap;
+       BibTeXInfo keyvalmap(false);
        keyvalmap[from_ascii("label")] = getParam("label");
        DocIterator doc_it(it); 
        doc_it.forwardPos();
        keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString(buf, false);
-       keyvalmap.isBibTeX = false;
        keys[key] = keyvalmap;
 }