]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetBibitem.cpp
index 829e15a52a22d642cc05dac70249dfa209adb3e4..924b931d82825a9794cf2cc9d0a7cf591fc5fb8f 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "InsetBibitem.h"
 
-#include "Biblio.h"
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
 
 namespace lyx {
 
-using support::prefixIs;
-
-using std::max;
-using std::string;
-using std::auto_ptr;
-using std::ostream;
 
 int InsetBibitem::key_counter = 0;
+
+
 docstring const key_prefix = from_ascii("key-");
 
+
 InsetBibitem::InsetBibitem(InsetCommandParams const & p)
        : InsetCommand(p, "bibitem")
 {
@@ -50,11 +46,11 @@ InsetBibitem::InsetBibitem(InsetCommandParams const & p)
 }
 
 
-auto_ptr<Inset> InsetBibitem::doClone() const
+Inset * InsetBibitem::clone() const
 {
-       auto_ptr<InsetBibitem> b(new InsetBibitem(params()));
+       InsetBibitem * b = new InsetBibitem(params());
        b->autolabel_ = autolabel_;
-       return auto_ptr<Inset>(b);
+       return b;
 }
 
 
@@ -70,7 +66,7 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
                        break;
                }
                if (p["key"] != params()["key"])
-                       cur.bv().buffer()->changeRefsIfUnique(params()["key"],
+                       cur.bv().buffer().changeRefsIfUnique(params()["key"],
                                                       p["key"], Inset::CITE_CODE);
                setParams(p);
        }
@@ -86,9 +82,9 @@ void InsetBibitem::read(Buffer const & buf, Lexer & lex)
 {
        InsetCommand::read(buf, lex);
 
-       if (prefixIs(getParam("key"), key_prefix)) {
+       if (support::prefixIs(getParam("key"), key_prefix)) {
                int const key = convert<int>(getParam("key").substr(key_prefix.length()));
-               key_counter = max(key_counter, key);
+               key_counter = std::max(key_counter, key);
        }
 }
 
@@ -183,14 +179,14 @@ docstring const bibitemWidest(Buffer const & buffer)
 
 
 void InsetBibitem::fillWithBibKeys(Buffer const & buf,
-       biblio::BibKeyList & keys, InsetIterator const & it) const
+       BiblioInfo & keys, InsetIterator const & it) const
 {
-       string const key = to_utf8(getParam("key"));
-       biblio::BibTeXInfo keyvalmap;
+       docstring const key = getParam("key");
+       BibTeXInfo keyvalmap;
        keyvalmap[from_ascii("label")] = getParam("label");
        DocIterator doc_it(it); 
        doc_it.forwardPos();
-       keyvalmap [from_ascii("ref")] = doc_it.paragraph().asString(buf, false);
+       keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString(buf, false);
        keyvalmap.isBibTeX = false;
        keys[key] = keyvalmap;
 }