]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathExtern.cpp
tex2lyx: support for \item with opt arg in itemize environment
[lyx.git] / src / mathed / MathExtern.cpp
index 949061017cd536e2364ec6fd0cdc1702def515fb..a943dac8028b8140c34e51d325fd2eec2c1472b8 100644 (file)
@@ -40,6 +40,7 @@
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
+#include "support/TempFile.h"
 
 #include <algorithm>
 #include <sstream>
@@ -995,7 +996,8 @@ namespace {
        {
                // In order to avoid parsing problems with command interpreters
                // we pass input data through a file
-               FileName const cas_tmpfile = FileName::tempName("casinput");
+               TempFile tempfile("casinput");
+               FileName const cas_tmpfile = tempfile.name();
                if (cas_tmpfile.empty()) {
                        lyxerr << "Warning: cannot create temporary file."
                               << endl;
@@ -1009,7 +1011,6 @@ namespace {
                lyxerr << "calling: " << cmd
                       << "\ninput: '" << data << "'" << endl;
                cmd_ret const ret = runCommand(command);
-               cas_tmpfile.removeFile();
                return ret.second;
        }
 
@@ -1196,7 +1197,7 @@ namespace {
                        istringstream is(out);
                        string line;
                        getline(is, line);
-                       if (line.find("on line") != 0)
+                       if (!prefixIs(line, "on line"))
                                break; // error message not identified
                        getline(is, line);
                        size_t pos = line.find('^');