}
+BiblioInfo const & Buffer::bibInfo() const
+{
+ return d->bibinfo_;
+}
+
+
void Buffer::checkIfBibInfoCacheIsValid() const
{
// use the master's cache
}
-void Buffer::addBiblioInfo(BiblioInfo const & bi) const
+void Buffer::addBiblioInfo(BiblioInfo const & bin) const
{
- Buffer const * tmp = masterBuffer();
- BiblioInfo & masterbi = (tmp == this) ?
- d->bibinfo_ : tmp->d->bibinfo_;
- masterbi.mergeBiblioInfo(bi);
+ BiblioInfo & bi = d->bibinfo_;
+ bi.mergeBiblioInfo(bin);
+
+ if (parent() != 0) {
+ BiblioInfo & masterbi = parent()->d->bibinfo_;
+ masterbi.mergeBiblioInfo(bin);
+ }
}
/// \return the bibliography information for this buffer's master,
/// or just for it, if it isn't a child.
BiblioInfo const & masterBibInfo() const;
+ /// \return this buffer's bibliography information
+ BiblioInfo const & bibInfo() const;
/// collect bibliography info from the various insets in this buffer.
void collectBibKeys(support::FileNameList &) const;
/// add some BiblioInfo to our cache
// engine, e.g. \cite[]{} for the basic engine.
void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
{
- BiblioInfo const & bi = buffer().masterBibInfo();
+ BiblioInfo const & bi = runparams.is_child
+ ? buffer().masterBibInfo() : buffer().bibInfo();
docstring const key = getParam("key");
// "keyonly" command: output the plain key and stop.
if (getCmdName() == "keyonly") {