mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Use separate BibInfo for child
This is used when the file is compiled standalone Fixes: #11083
This commit is contained in:
parent
83b1ac3b55
commit
1c623ffe8f
@ -2343,10 +2343,16 @@ BiblioInfo const & Buffer::masterBibInfo() const
|
||||
}
|
||||
|
||||
|
||||
BiblioInfo const & Buffer::bibInfo() const
|
||||
{
|
||||
return d->bibinfo_;
|
||||
}
|
||||
|
||||
|
||||
void Buffer::registerBibfiles(FileNamePairList const & bf) const {
|
||||
Buffer const * const tmp = masterBuffer();
|
||||
if (tmp != this)
|
||||
return tmp->registerBibfiles(bf);
|
||||
tmp->registerBibfiles(bf);
|
||||
|
||||
for (auto const & p : bf) {
|
||||
FileNamePairList::const_iterator temp =
|
||||
@ -2415,12 +2421,15 @@ void Buffer::collectBibKeys(FileNameList & checkedFiles) const
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -508,6 +508,8 @@ public:
|
||||
/// \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
|
||||
|
@ -552,7 +552,8 @@ void InsetCitation::forOutliner(docstring & os, size_t const, bool const) const
|
||||
// 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") {
|
||||
|
Loading…
Reference in New Issue
Block a user