On 10/05/2010 04:12 AM, Vincent van Ravesteijn wrote:
 Op 29-9-2010 13:59, rgh...@lyx.org schreef:
Author: rgheck
Date: Wed Sep 29 13:59:31 2010
New Revision: 35530
URL: http://www.lyx.org/trac/changeset/35530

Log:
Use getChildren() to collect all the relatives. Note that this makes
allRelatives() "stable", in the sense that what it returns does not
depend upon which Buffer we start with.


-void Buffer::Impl::collectRelatives(BufferSet&  bufs) const
-{
-    bufs.insert(owner_);
-    if (parent())
-        parent()->d->collectRelatives(bufs);
-
-    // loop over children
-    BufferPositionMap::const_iterator it = children_positions.begin();
-    BufferPositionMap::const_iterator end = children_positions.end();
-    for (; it != end; ++it)
-        bufs.insert(const_cast<Buffer *>(it->first));
-}
-
-
  ListOfBuffers Buffer::allRelatives() const
  {
-    BufferSet bufs;
-    d->collectRelatives(bufs);
-    BufferSet::iterator it = bufs.begin();
-    ListOfBuffers ret;
-    for (; it != bufs.end(); ++it)
-        ret.push_back(*it);
-    return ret;
+    if (parent())
+        return parent()->allRelatives();
+    return getChildren(/* true */);
  }


This is wrong. Now, allRelatives does not contain the root document itself anymore.

Whoops.

Note you lost "bufs.insert(owner_);" that was in collectRelatives.

This causes bug #6929.

Fixed.

rh

Reply via email to