From 058035bf2c19c896c177f761c2a2bfbe3edef847 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Mon, 25 Oct 2010 09:49:24 +0000 Subject: [PATCH] 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 --- src/Buffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5