diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 3eae06e13c..0013804d77 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2090,7 +2090,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr) bool success = false; for (; it != end; ++it) { if (it->lyxCode() == BRANCH_CODE) { - InsetBranch & ins = static_cast(*it); + InsetBranch & ins = dynamic_cast(*it); if (ins.branch() == oldname) { undo().recordUndo(it); ins.rename(newname); @@ -2835,7 +2835,7 @@ void Buffer::getUsedBranches(std::list & result, bool const from_mast InsetIterator const end = inset_iterator_end(inset()); for (; it != end; ++it) { if (it->lyxCode() == BRANCH_CODE) { - InsetBranch & br = static_cast(*it); + InsetBranch & br = dynamic_cast(*it); docstring const name = br.branch(); if (!from_master && !params().branchlist().find(name)) result.push_back(name);