mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Keep the "find the master" recursion in masterDocument().
We should probably be checking for recursive includes here, and we want to do that in one place. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35537 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
da0f528287
commit
a6d22abf03
@ -1682,10 +1682,9 @@ void Buffer::validate(LaTeXFeatures & features) const
|
|||||||
|
|
||||||
void Buffer::getLabelList(vector<docstring> & list) const
|
void Buffer::getLabelList(vector<docstring> & list) const
|
||||||
{
|
{
|
||||||
// If this is a child document, use the parent's list instead.
|
// If this is a child document, use the master's list instead.
|
||||||
Buffer const * const pbuf = d->parent();
|
if (parent()) {
|
||||||
if (pbuf) {
|
masterBuffer()->getLabelList(list);
|
||||||
pbuf->getLabelList(list);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1704,9 +1703,8 @@ void Buffer::updateBibfilesCache(UpdateScope scope) const
|
|||||||
{
|
{
|
||||||
// FIXME This is probably unnecssary, given where we call this.
|
// FIXME This is probably unnecssary, given where we call this.
|
||||||
// If this is a child document, use the parent's cache instead.
|
// If this is a child document, use the parent's cache instead.
|
||||||
Buffer const * const pbuf = d->parent();
|
if (parent() && scope != UpdateChildOnly) {
|
||||||
if (pbuf && scope != UpdateChildOnly) {
|
masterBuffer()->updateBibfilesCache();
|
||||||
pbuf->updateBibfilesCache();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2483,13 +2481,15 @@ Buffer const * Buffer::parent() const
|
|||||||
ListOfBuffers Buffer::allRelatives() const
|
ListOfBuffers Buffer::allRelatives() const
|
||||||
{
|
{
|
||||||
if (parent())
|
if (parent())
|
||||||
return parent()->allRelatives();
|
return masterBuffer()->allRelatives();
|
||||||
return getChildren(/* true */);
|
return getChildren(/* true */);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Buffer const * Buffer::masterBuffer() const
|
Buffer const * Buffer::masterBuffer() const
|
||||||
{
|
{
|
||||||
|
// FIXME Should be make sure we are not in some kind
|
||||||
|
// of recursive include? A -> B -> A will crash this.
|
||||||
Buffer const * const pbuf = d->parent();
|
Buffer const * const pbuf = d->parent();
|
||||||
if (!pbuf)
|
if (!pbuf)
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user