From 8cd80803220e02f7a9148f11b99f4f3aeb0d3f38 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 9 Jun 2016 16:02:39 +0200 Subject: [PATCH] Please Coverity (code should be equivalent) The parameter passed to allowDisplayMath will need to be copied, so it made sense to pass it by value. Since Coverity complains about that, the code is rewritten to make the copy explicit. --- src/mathed/InsetMathHull.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 34955147e2..e253635f15 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1872,13 +1872,14 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd) namespace { -bool allowDisplayMath(Cursor cur) +bool allowDisplayMath(Cursor const & cur) { LATTEST(cur.depth() > 1); - cur.pop(); + Cursor tmpcur = cur; + tmpcur.pop(); FuncStatus status; FuncRequest cmd(LFUN_MATH_DISPLAY); - return cur.getStatus(cmd, status) && status.enabled(); + return tmpcur.getStatus(cmd, status) && status.enabled(); } }