namespace os = support::os;
-InsetBibtex::InsetBibtex(InsetCommandParams const & p)
+InsetBibtex::InsetBibtex(Buffer const & buf, InsetCommandParams const & p)
: InsetCommand(p, "bibtex")
-{}
+{
+ Inset::setBuffer(const_cast<Buffer &>(buf));
+ buffer_->invalidateBibinfoCache();
+}
+
+
+InsetBibtex::~InsetBibtex()
+{
+ if (isBufferValid())
+ buffer_->invalidateBibinfoCache();
+}
ParamInfo const & InsetBibtex::findInfo(string const & /* cmdName */)
{
switch (cmd.action) {
case LFUN_INSET_EDIT:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
docstring InsetBibtex::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/) const
{
docstring item = from_ascii("* ");
- docstring tip = _("Databases:\n");
+ docstring tip = _("Databases:") + "\n";
vector<docstring> bibfilelist = getVectorFromString(getParam("bibfiles"));
if (bibfilelist.empty()) {
style = split(style, bibtotoc, char_type(','));
}
- tip += _("Style File:\n");
+ tip += _("Style File:") +"\n";
tip += item;
if (!style.empty())
tip += style;
else
tip += _("none");
- tip += _("\nLists: ");
+ tip += "\n" + _("Lists:") + " ";
docstring btprint = getParam("btprint");
if (btprint == "btPrintAll")
tip += _("all references");
for (; it != en; ++it) {
FileName const file =
findtexfile(changeExtension(to_utf8(*it), "bib"), "bib");
-
- // If we didn't find a matching file name just fail silently
+
if (!file.empty())
vec.push_back(file);
+ else
+ LYXERR0("Couldn't find " + to_utf8(*it) + " in InsetBibtex::getBibFiles()!");
}
return vec;