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.
This commit is contained in:
Jean-Marc Lasgouttes 2016-06-09 16:02:39 +02:00
parent 731dbddd11
commit 8cd8080322

View File

@ -1872,13 +1872,14 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
namespace { namespace {
bool allowDisplayMath(Cursor cur) bool allowDisplayMath(Cursor const & cur)
{ {
LATTEST(cur.depth() > 1); LATTEST(cur.depth() > 1);
cur.pop(); Cursor tmpcur = cur;
tmpcur.pop();
FuncStatus status; FuncStatus status;
FuncRequest cmd(LFUN_MATH_DISPLAY); FuncRequest cmd(LFUN_MATH_DISPLAY);
return cur.getStatus(cmd, status) && status.enabled(); return tmpcur.getStatus(cmd, status) && status.enabled();
} }
} }