]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeX.C
Applied Angus patch to compile on DEC C++ and to avoid name clashes
[lyx.git] / src / LaTeX.C
index 2a70e096df653da3d2519e42c7e6a0a851e9a961..968d15845b59b2bc9fe19027e6ddaaf7f4ad6e4c 100644 (file)
@@ -113,7 +113,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        // in it. However it seems safe to run latex (at least) on time each
        // time the .tex file changes.
 {
-       int scanres = LaTeX::NO_ERRORS;
+       int scanres = NO_ERRORS;
        unsigned int count = 0; // number of times run
        num_errors = 0; // just to make sure.
        const unsigned int MAX_RUN = 6;
@@ -154,7 +154,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                head.update();
                if (!head.sumchange()) {
                        lyxerr[Debug::DEPEND] << "return no_change" << endl;
-                       return LaTeX::NO_CHANGE;
+                       return NO_CHANGE;
                }
                lyxerr[Debug::DEPEND]
                        << "Dependency file has changed" << endl;
@@ -177,13 +177,13 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
        this->operator()();
        scanres = scanLogFile(terr);
-       if (scanres & LaTeX::ERROR_RERUN) {
+       if (scanres & ERROR_RERUN) {
                lyxerr[Debug::LATEX] << "Rerunning LaTeX" << endl;
                this->operator()();
                scanres = scanLogFile(terr);
        }
 
-       if (scanres & LaTeX::ERRORS) {
+       if (scanres & ERRORS) {
                deleteFilesOnError();
                return scanres; // return on error
        }
@@ -212,9 +212,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        }
 
        // run bibtex
-       if (scanres & LaTeX::UNDEF_CIT
-           || scanres & LaTeX::RERUN
-           || run_bibtex) {
+       // if (scanres & UNDEF_CIT || scanres & RERUN || run_bibtex)
+       if (scanres & UNDEF_CIT || run_bibtex) {
                // Here we must scan the .aux file and look for
                // "\bibdata" and/or "\bibstyle". If one of those
                // tags is found -> run bibtex and set rerun = true;
@@ -252,7 +251,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                            string(_("LaTeX run number ")) + tostr(count));
                this->operator()();
                scanres = scanLogFile(terr);
-               if (scanres & LaTeX::ERRORS) {
+               if (scanres & ERRORS) {
                        deleteFilesOnError();
                        return scanres; // return on error
                }
@@ -290,7 +289,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        //     -> rerun not asked for:
        //             just return (fall out of bottom of func)
        //
-       while ((head.sumchange() || rerun || (scanres & LaTeX::RERUN)) 
+       while ((head.sumchange() || rerun || (scanres & RERUN)) 
               && count < MAX_RUN) {
                // Yes rerun until message goes away, or until
                // MAX_RUNS are reached.
@@ -300,7 +299,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
                this->operator()();
                scanres = scanLogFile(terr);
-               if (scanres & LaTeX::ERRORS) {
+               if (scanres & ERRORS) {
                        deleteFilesOnError();
                        return scanres; // return on error
                }
@@ -585,7 +584,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                                retval |= TEX_WARNING;
                        } else if (contains(token, "Rerun to get citations")) {
                                // Natbib seems to use this.
-                               retval |= RERUN;
+                               retval |= UNDEF_CIT;
                        } else if (contains(token, "No pages of output")) {
                                // A dvi file was not created
                                retval |= NO_OUTPUT;
@@ -665,12 +664,11 @@ void LaTeX::deplog(DepTable & head)
                        // since this file can not be a file generated by
                        // the latex run.
                        head.insert(foundfile, true);
-                       continue;
                }
 
                // (2) foundfile is in the tmpdir
                //     insert it into head
-               if (FileInfo(OnlyFilename(foundfile)).exist()) {
+               else if (FileInfo(OnlyFilename(foundfile)).exist()) {
                        if (unwanted.exact_match(foundfile)) {
                                lyxerr[Debug::DEPEND]
                                        << "We don't want "
@@ -693,10 +691,9 @@ void LaTeX::deplog(DepTable & head)
                                        << endl;
                                head.insert(OnlyFilename(foundfile));
                        }
-                       continue;
-               }
-               lyxerr[Debug::DEPEND]
-                       << "Not a file or we are unable to find it."
-                       << endl;
+               } else
+                       lyxerr[Debug::DEPEND]
+                               << "Not a file or we are unable to find it."
+                               << endl;
        }
 }