From: Vincent van Ravesteijn Date: Mon, 25 Oct 2010 09:49:24 +0000 (+0000) Subject: One should use dynamic_casts for inheritance-based casting. X-Git-Tag: 2.0.0~2268 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=058035bf2c19c896c177f761c2a2bfbe3edef847;p=lyx.git One should use dynamic_casts for inheritance-based casting. (This is a little necessary clean-up of my tree.) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35817 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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);