#include "frontends/alert.h"
+#include "support/lassert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/docstream.h"
InsetBibitem::~InsetBibitem()
{
- if (isBufferLoaded())
- buffer().invalidateBibinfoCache();
+ if (isBufferLoaded()) {
+ /* We do not use buffer() because Coverity believes that this
+ * may throw an exception. Actually this code path is not
+ * taken when buffer_ == 0 */
+ buffer_->invalidateBibinfoCache();
+ }
}
param_info_.add("label", ParamInfo::LATEX_OPTIONAL,
ParamInfo::HANDLING_LATEXIFY);
param_info_.add("key", ParamInfo::LATEX_REQUIRED,
- ParamInfo::HANDLING_ESCAPE);
+ ParamInfo::ParamHandling(ParamInfo::HANDLING_ESCAPE
+ | ParamInfo::HANDLING_LTRIM));
param_info_.add("literal", ParamInfo::LYX_INTERNAL);
}
return param_info_;
ParagraphList::const_iterator it = buffer.paragraphs().begin();
ParagraphList::const_iterator end = buffer.paragraphs().end();
+ bool is_literal = false;
for (; it != end; ++it) {
if (it->insetList().empty())
continue;
if (wx > w) {
w = wx;
lbl = label;
+ is_literal = (bitem->getParam("literal") == "true");
}
}
if (!lbl.empty()) {
InsetCommandParams p(BIBITEM_CODE);
+ if (is_literal)
+ p["literal"] = from_ascii("true");
return p.prepareCommand(runparams, lbl, ParamInfo::HANDLING_LATEXIFY);
}
}
-void InsetBibitem::collectBibKeys(InsetIterator const & it) const
+void InsetBibitem::collectBibKeys(InsetIterator const & it, FileNameList & /*checkedFiles*/) const
{
docstring const key = getParam("key");
docstring const label = getParam("label");