X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathExtern.cpp;h=52fa0cf0fa831fa4913810bb900519f87d009faa;hb=0cba074ecf0e25ede759ee1f817a7cfec06537d6;hp=8b1e0f0c8d52a861f50f05edec7611db4ec8d982;hpb=6dfc255088ecd3393c4c5dc3d2c5357a3fbabfc0;p=lyx.git diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index 8b1e0f0c8d..52fa0cf0fa 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -115,7 +115,7 @@ bool extractScript(MathData & ar, // try to extract an "argument" to some function. // returns position behind the argument MathData::iterator extractArgument(MathData & ar, - MathData::iterator pos, MathData::iterator last, + MathData::iterator pos, MathData::iterator last, ExternalMath kind, bool function = false) { // nothing to get here @@ -211,7 +211,7 @@ void extractMatrices(MathData & ar) continue; if (!arr.front()->asGridInset()) continue; - ar[i] = MathAtom(new InsetMathMatrix(*(arr.front()->asGridInset()), + ar[i] = MathAtom(new InsetMathMatrix(*(arr.front()->asGridInset()), inset->left_, inset->right_)); } @@ -602,7 +602,7 @@ void extractFunctions(MathData & ar, ExternalMath kind) auto p = make_unique(buf, name); // jt points to the "argument". Get hold of this. - MathData::iterator st = + MathData::iterator st = extractArgument(p->cell(0), jt, ar.end(), kind, true); // replace the function name by a real function inset @@ -896,6 +896,10 @@ void extractDiff(MathData & ar) int mult = 1; if (extractNumber(script->up(), mult)) { //lyxerr << "mult: " << mult << endl; + if (mult < 0 || mult > 1000) { + lyxerr << "Cannot differentiate less than 0 or more than 1000 times !" << endl; + continue; + } for (int i = 0; i < mult; ++i) diff->addDer(MathData(buf, dt + 1, st)); } @@ -1021,6 +1025,7 @@ namespace { lyxerr << "calling: " << cmd << "\ninput: '" << data << "'" << endl; cmd_ret const ret = runCommand(command); + cas_tmpfile.removeFile(); return ret.second; } @@ -1386,9 +1391,9 @@ namespace { return res; } -} +} // namespace -} // anon namespace +} // namespace void write(MathData const & dat, WriteStream & wi) {