keep a cast for later

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29551 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-05-06 13:41:35 +00:00
parent cd62043a1b
commit 36a811cba2

View File

@ -147,12 +147,12 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_BRANCH_ACTIVATE:
case LFUN_BRANCH_DEACTIVATE: {
// FIXME: I do not like this cast, but have no other idea...
Buffer * realbuffer = const_cast<Buffer *>(buffer().masterBuffer());
BranchList & branchlist = realbuffer->params().branchlist();
Branch * ourBranch = branchlist.find(params_.branch);
if (!ourBranch)
Buffer const * buf = buffer().masterBuffer();
BranchList const & branchlist = buf->params().branchlist();
Branch * our_branch = const_cast<Branch *>(branchlist.find(params_.branch));
if (!our_branch)
break;
ourBranch->setSelected(cmd.action == LFUN_BRANCH_ACTIVATE);
our_branch->setSelected(cmd.action == LFUN_BRANCH_ACTIVATE);
break;
}