> > New Revision: 32738
> > URL: <http://www.lyx.org/trac/changeset/32738>
> > Log: When reloading a child document, reset the parent of the child 
> > to the parent of the child and not to the master.
>
> I'm not sure this change is correct. For instance:
>
>-       Buffer const * master = buf->masterBuffer();
>-       bool const is_child = master != buf;
>+       Buffer const * parent = buf->parent();
>+       bool const is_child = parent != buf;
>
>AFAIU, parent is never == buf. Parent is either the parent
>buffer (which includes buf) or it is 0. The master, as
>opposed to that, is either the parent buffer or (if there
>is no parent) buf.
>

You're right. Now is_child will be true always. But, it has no consequence for 
the rest of the code. 

if (is_child && theBufferList().isLoaded(parent)
     && buf->parent() != parent)
    buf->setParent(parent);

If parent is 0, is_child is true (which is wrong), but the isLoaded will always 
be false, so all ends up ok.

I'll correct this.

>
>What is the intention of this change?
>

The problem was that if you have 3 docs A parent of B parent of C, and if you 
reload C, then the parent of C becomes A and not B. This has some consequences, 
but to be honest I don't remember now how I can demonstrate that.

>Jürgen

Vincent

Reply via email to