Abdel,
I am not the author of this code. "svn blame" mentions my name because I
fixed change tracking, i.e., insertInset(...) considers the value of
buffer.params().trackChanges.
I guess the bibitem code handles bibliography entries that are entered
directly in LyX (not via Bibtex). Whether the code still makes sense is
another question. I suggest playing a bit with the "Bibliography" layout
of some "article" document class...
Michael
// Add bibitem insets if necessary
if (par.layout()->labeltype == LABEL_BIBLIO) {
bool hasbibitem(false);
if (!par.insetlist.empty()
// Insist on it being in pos 0
&& par.getChar(0) == Paragraph::META_INSET) {
InsetBase * inset = par.insetlist.begin()->inset;
if (inset->lyxCode() == InsetBase::BIBITEM_CODE)
hasbibitem = true;
}
if (!hasbibitem) {
InsetBibitem * inset(new
InsetBibitem(InsetCommandParams("bibitem")));
par.insertInset(0, static_cast<InsetBase *>(inset),
Change(buffer.params().trackChanges ?
Change::INSERTED : Change::UNCHANGED));
bv.cursor().posRight();
}
}