]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Whitespace.
[lyx.git] / src / Buffer.cpp
index d977e2c2112e45a8dade542c17cafbcfebdd3a78..74582bc90437a47b831d8da59c33871f4f3cef01 100644 (file)
@@ -1765,6 +1765,25 @@ DocIterator Buffer::firstChildPosition(Buffer const * child)
 }
 
 
+std::vector<Buffer *> Buffer::getChildren() const
+{
+       std::vector<Buffer *> clist;
+       // loop over children
+       Impl::BufferPositionMap::iterator it = d->children_positions.begin();
+       Impl::BufferPositionMap::iterator end = d->children_positions.end();
+       for (; it != end; ++it) {
+               Buffer * child = const_cast<Buffer *>(it->first);
+               clist.push_back(child);
+               // there might be grandchildren
+               std::vector<Buffer *> glist = child->getChildren();
+               for (vector<Buffer *>::const_iterator git = glist.begin();
+                    git != glist.end(); ++git)
+                       clist.push_back(*git);
+       }
+       return clist;
+}
+
+
 template<typename M>
 typename M::iterator greatest_below(M & m, typename M::key_type const & x)
 {
@@ -2744,7 +2763,6 @@ void Buffer::updateLabels(bool childonly) const
 
        // update all caches
        clearReferenceCache();
-       inset().setBuffer(const_cast<Buffer &>(*this));
        updateMacros();
 
        Buffer & cbuf = const_cast<Buffer &>(*this);