#include "BiblioInfo.h"
#include "Buffer.h"
+#include "Cursor.h"
#include "buffer_funcs.h"
#include "BufferParams.h"
#include "BufferView.h"
InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "bibitem")
+ : InsetCommand(buf, p)
{
buffer().invalidateBibinfoCache();
if (getParam("key").empty())
cur.noScreenUpdate();
break;
}
+
+ cur.recordUndo();
+
docstring const & old_key = params()["key"];
docstring const & old_label = params()["label"];
docstring label = p["label"];
}
-void InsetBibitem::fillWithBibKeys(BiblioInfo & keys, InsetIterator const & it) const
+void InsetBibitem::collectBibKeys(InsetIterator const & it) const
{
docstring const key = getParam("key");
BibTeXInfo keyvalmap(false);
DocIterator doc_it(it);
doc_it.forwardPos();
keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString();
- keys[key] = keyvalmap;
+ buffer().addBibTeXInfo(key, keyvalmap);
}
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & counters = bp.documentClass().counters();
docstring const bibitem = from_ascii("bibitem");
- if (counters.hasCounter(bibitem) && getParam("label").empty()) {
- counters.step(bibitem, utype);
+ if (getParam("label").empty()) {
+ if (counters.hasCounter(bibitem))
+ counters.step(bibitem, utype);
string const & lang = it.paragraph().getParLanguage(bp)->code();
autolabel_ = counters.theCounter(bibitem, lang);
} else {