#include "support/lstrings.h"
#include "support/TempFile.h"
#include "support/textutils.h"
+#include "support/unique_ptr.h"
#include <algorithm>
#include <sstream>
// create extra script inset and move superscript over
InsetMathScript * p = ar[i].nucleus()->asScriptInset();
- auto_ptr<InsetMathScript> q(new InsetMathScript(buf, true));
+ auto q = make_unique<InsetMathScript>(buf, true);
swap(q->up(), p->up());
p->removeScript(true);
extractScript(exp, jt, ar.end(), true);
// create a proper inset as replacement
- auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(buf, name));
+ auto p = make_unique<InsetMathExFunc>(buf, name);
// jt points to the "argument". Get hold of this.
MathData::iterator st =
continue;
// core ist part from behind the scripts to the 'd'
- auto_ptr<InsetMathExInt> p(new InsetMathExInt(buf, from_ascii("int")));
+ auto p = make_unique<InsetMathExInt>(buf, from_ascii("int"));
// handle scripts if available
if (!testIntSymbol(*it)) {
continue;
// create a proper inset as replacement
- auto_ptr<InsetMathExInt> p(new InsetMathExInt(buf, from_ascii("sum")));
+ auto p = make_unique<InsetMathExInt>(buf, from_ascii("sum"));
// collect lower bound and summation index
InsetMathScript const * sub = ar[i]->asScriptInset();
}
// create a proper diff inset
- auto_ptr<InsetMathDiff> diff(new InsetMathDiff(buf));
+ auto diff = make_unique<InsetMathDiff>(buf);
// collect function, let jt point behind last used item
MathData::iterator jt = it + 1;
{
// In order to avoid parsing problems with command interpreters
// we pass input data through a file
- TempFile tempfile("casinput");
- FileName const cas_tmpfile = tempfile.name();
+ // Since the CAS is supposed to read the temp file we need
+ // to unlock it on windows (bug 10262).
+ unique_ptr<TempFile> tempfile(new TempFile("casinput"));
+ tempfile->setAutoRemove(false);
+ FileName const cas_tmpfile = tempfile->name();
+ tempfile.reset();
+
if (cas_tmpfile.empty()) {
lyxerr << "Warning: cannot create temporary file."
<< endl;
lyxerr << "calling: " << cmd
<< "\ninput: '" << data << "'" << endl;
cmd_ret const ret = runCommand(command);
+ cas_tmpfile.removeFile();
return ret.second;
}
if (tmp.size() < 2)
return MathData();
- out = subst(tmp[1], "\\>", string());
+ out = subst(subst(tmp[1], "\\>", string()), "{\\it ", "\\mathit{");
lyxerr << "output: '" << out << "'" << endl;
// Ugly code that tries to make the result prettier