+/**
+ * \file InsetList.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author Martin Vermeer
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
#include <config.h>
#include "InsetList.h"
+#include "BufferView.h"
+#include "buffer.h"
#include "debug.h"
#include "insets/updatableinset.h"
+#include "insets/insetbranch.h"
#include <algorithm>
}
-void InsetList::resizeInsetsLyXText(BufferView * bv)
+void InsetList::insetsOpenCloseBranch(BufferView * bv)
{
+ BufferParams bp = bv->buffer()->params;
List::iterator it = list.begin();
List::iterator end = list.end();
for (; it != end; ++it) {
- if (it->inset) {
- if (it->inset->isTextInset()) {
- static_cast<UpdatableInset*>
- (it->inset)->resizeLyXText(bv, true);
+ if (it->inset && it->inset->lyxCode() == InsetOld::BRANCH_CODE) {
+ InsetBranch * inset = static_cast<InsetBranch *>(it->inset);
+ if (bp.branchlist.selected(inset->params().branch)) {
+ inset->open(bv);
+ } else {
+ inset->close(bv);
}
}
}
}
+
+