#include "FuncRequest.h"
#include "InsetIterator.h"
#include "InsetList.h"
-#include "Language.h"
+#include "Language.h"
#include "Lexer.h"
#include "output_xhtml.h"
#include "OutputParams.h"
cur.noScreenUpdate();
break;
}
+
+ cur.recordUndo();
+
docstring const & old_key = params()["key"];
docstring const & old_label = params()["label"];
docstring label = p["label"];
if (label[previous] != '{')
label.replace(pos, 1, lbrace + brackets_escape[k] + rbrace);
}
+ }
- if (old_label != label) {
- p["label"] = label;
- cur.forceBufferUpdate();
- buffer().invalidateBibinfoCache();
- }
+ if (old_label != label) {
+ p["label"] = label;
+ cur.forceBufferUpdate();
+ buffer().invalidateBibinfoCache();
}
setParam("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);
keyvalmap.label(bibLabel());
- DocIterator doc_it(it);
+ DocIterator doc_it(it);
doc_it.forwardPos();
- keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString();
- keys[key] = keyvalmap;
+ keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString(
+ AS_STR_INSETS | AS_STR_SKIPDELETE);
+ buffer().addBibTeXInfo(key, keyvalmap);
}
} else {
autolabel_ = from_ascii("??");
}
- if (!buffer().isBibInfoCacheValid()) {
- BiblioInfo bi = buffer().masterBibInfo();
- docstring const key = getParam("key");
- BibTeXInfo keyvalmap(false);
- keyvalmap.label(bibLabel());
- keyvalmap[from_ascii("ref")] = it.paragraph().asString();
- bi[key] = keyvalmap;
- }
}