X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FInsetList.C;h=df45a985db02a0c7919a02b469f440fe92527b1b;hb=1cad117882dc393b2d55174c6f2ab67920a54ce1;hp=43027b3b9189d8fee4e3fdc14e004478cd106aa2;hpb=83ceb3c57b371c71c1706ecc371e624162f5ccef;p=features.git diff --git a/src/InsetList.C b/src/InsetList.C index 43027b3b91..df45a985db 100644 --- a/src/InsetList.C +++ b/src/InsetList.C @@ -15,6 +15,7 @@ #include "buffer.h" #include "bufferparams.h" +#include "BranchList.h" #include "BufferView.h" #include "debug.h" @@ -139,13 +140,15 @@ void InsetList::insetsOpenCloseBranch(Buffer const & buf) List::iterator it = list.begin(); List::iterator end = list.end(); for (; it != end; ++it) { - if (it->inset && it->inset->lyxCode() == InsetOld::BRANCH_CODE) { - InsetBranch * inset = static_cast(it->inset); - if (buf.params().branchlist().selected(inset->params().branch)) { - inset->open(); - } else { - inset->close(); - } + if (!it->inset || + it->inset->lyxCode() != InsetOld::BRANCH_CODE) + continue; + + InsetBranch * inset = static_cast(it->inset); + if (inset->isBranchSelected(buf.params().branchlist())) { + inset->open(); + } else { + inset->close(); } } }