X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FInsetList.C;h=abe2d6577e1c91344d0b4703803b4cac4eebf6ec;hb=24f8676130d1e0769db394b7142dae7eeb1d955e;hp=2804cef1f1f71a996ec22cbf4da9f754c042529e;hpb=2e57f2ff0ae7cd4a6efbf634ffe6d2f4379d9cfc;p=lyx.git diff --git a/src/InsetList.C b/src/InsetList.C index 2804cef1f1..abe2d6577e 100644 --- a/src/InsetList.C +++ b/src/InsetList.C @@ -1,9 +1,23 @@ +/** + * \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 #include "InsetList.h" +#include "BufferView.h" +#include "buffer.h" #include "debug.h" #include "insets/updatableinset.h" +#include "insets/insetbranch.h" #include @@ -178,16 +192,21 @@ void InsetList::deleteInsetsLyXText(BufferView * bv) } -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 - (it->inset)->resizeLyXText(bv, true); + if (it->inset && it->inset->lyxCode() == InsetOld::BRANCH_CODE) { + InsetBranch * inset = static_cast(it->inset); + if (bp.branchlist.selected(inset->params().branch)) { + inset->open(bv); + } else { + inset->close(bv); } } } } + +