]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeX.C
Dekels tabular/textinset patches
[lyx.git] / src / LaTeX.C
index 36de5a4b0c714fef6a3aa5d80a61af8ab8dae36b..2485f03371fc263a38fe8bbc372d006009952a70 100644 (file)
@@ -31,6 +31,7 @@
 #include "bufferlist.h"
 #include "minibuffer.h"
 #include "gettext.h"
+#include "lyx_gui_misc.h"
 
 using std::ifstream;
 using std::getline;
@@ -83,7 +84,7 @@ void LaTeX::deleteFilesOnError() const
        // What files do we have to delete?
 
        // This will at least make latex do all the runs
-       ::unlink(depfile.c_str());
+       lyx::unlink(depfile);
 
        // but the reason for the error might be in a generated file...
 
@@ -91,15 +92,15 @@ void LaTeX::deleteFilesOnError() const
 
        // bibtex file
        string bbl = ChangeExtension(ofname, ".bbl");
-       ::unlink(bbl.c_str());
+       lyx::unlink(bbl);
 
        // makeindex file
        string ind = ChangeExtension(ofname, ".ind");
-       ::unlink(ind.c_str());
+       lyx::unlink(ind);
        
        // Also remove the aux file
        string aux = ChangeExtension(ofname, ".aux");
-       ::unlink(aux.c_str());
+       lyx::unlink(aux);
 }
 
 
@@ -118,7 +119,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        bool rerun = false; // rerun requested
        
        // The class LaTeX does not know the temp path.
-       bufferlist.updateIncludedTeXfiles(GetCWD());
+       bufferlist.updateIncludedTeXfiles(lyx::getcwd()); //GetCWD());
        
        // Never write the depfile if an error was encountered.
        
@@ -152,8 +153,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                                << "Dependency file has changed" << endl;
                        lyxerr[Debug::LATEX]
                                << "Run #" << count << endl; 
-                       minib->Set(string(_("LaTeX run number ")) + tostr(count));
-                       minib->Store();
+                       WriteStatus(minib,
+                                   string(_("LaTeX run number ")) + tostr(count));
                        this->operator()();
                        scanres = scanLogFile(terr);
                        if (scanres & LaTeX::ERRORS) {
@@ -177,8 +178,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                lyxerr[Debug::LATEX]
                        << "Run #" << count << endl;
                head.insert(file, true);
-               minib->Set(string(_("LaTeX run number ")) + tostr(count));
-               minib->Store();
+               WriteStatus(minib,
+                           string(_("LaTeX run number ")) + tostr(count));
                this->operator()();
                scanres = scanLogFile(terr);
                if (scanres & LaTeX::ERRORS) {
@@ -203,8 +204,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) {
                // no checks for now
                lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
-               minib->Set(_("Running MakeIndex."));
-               minib->Store();
+               WriteStatus(minib, _("Running MakeIndex."));
                rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
        }
 
@@ -217,8 +217,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                // tags is found -> run bibtex and set rerun = true;
                // no checks for now
                lyxerr[Debug::LATEX] << "Running BibTeX." << endl;
-               minib->Set(_("Running BibTeX."));
-               minib->Store();
+               WriteStatus(minib, _("Running BibTeX."));
                rerun = runBibTeX(OnlyFilename(ChangeExtension(file, ".aux")), 
                                  head);
        }
@@ -242,8 +241,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                        << "Dep. file has changed or rerun requested" << endl;
                lyxerr[Debug::LATEX]
                        << "Run #" << count << endl;
-               minib->Set(string(_("LaTeX run number ")) + tostr(count));
-               minib->Store();
+               WriteStatus(minib,
+                           string(_("LaTeX run number ")) + tostr(count));
                this->operator()();
                scanres = scanLogFile(terr);
                if (scanres & LaTeX::ERRORS) {
@@ -270,8 +269,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) {
                // no checks for now
                lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
-               minib->Set(_("Running MakeIndex."));
-               minib->Store();
+               WriteStatus(minib, _("Running MakeIndex."));
                rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
        }
        
@@ -292,8 +290,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                rerun = false;
                ++count;
                lyxerr[Debug::LATEX] << "Run #" << count << endl;
-               minib->Set(string(_("LaTeX run number ")) + tostr(count));
-               minib->Store();
+               WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
                this->operator()();
                scanres = scanLogFile(terr);
                if (scanres & LaTeX::ERRORS) {
@@ -596,7 +593,7 @@ void LaTeX::deplog(DepTable & head)
 
        string logfile = OnlyFilename(ChangeExtension(file, ".log"));
 
-       LRegex reg1(")* *\\(([^ ]+).*");
+       LRegex reg1(")* *\\(([^ \\)]+).*");
        LRegex reg2("File: ([^ ]+).*");
        LRegex reg3("No file ([^ ]+)\\..*");
        LRegex reg4("\\\\openout[0-9]+.*=.*`([^ ]+)'\\..*");
@@ -640,7 +637,7 @@ void LaTeX::deplog(DepTable & head)
                // Ok now we found a file.
                // Now we should make sure that this is a file that we can
                // access through the normal paths.
-               // We will not try any fance search methods to
+               // We will not try any fancy search methods to
                // find the file.
                
                // (1) foundfile is an
@@ -649,7 +646,7 @@ void LaTeX::deplog(DepTable & head)
                if (AbsolutePath(foundfile)) {
                        lyxerr[Debug::DEPEND] << "AbsolutePath file: " 
                                              << foundfile << endl;
-                       // On inital insert we want to do the update at once
+                       // On initial insert we want to do the update at once
                        // since this file can not be a file generated by
                        // the latex run.
                        head.insert(foundfile, true);