I am pretty sure we do not want duplicates here. What's worse, recursive

includes could crash this if we allow them.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35534 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-09-29 12:30:31 +00:00
parent 2f1af8892b
commit 6a85b8a96e

View File

@ -2527,6 +2527,10 @@ void Buffer::getChildren(ListOfBuffers & clist, bool grand_children) const
Impl::BufferPositionMap::iterator end = d->children_positions.end();
for (; it != end; ++it) {
Buffer * child = const_cast<Buffer *>(it->first);
// No duplicates
ListOfBuffers::const_iterator bit = find(clist.begin(), clist.end(), child);
if (bit != clist.end())
continue;
clist.push_back(child);
if (grand_children)
// there might be grandchildren