]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeX.cpp
fix warning
[lyx.git] / src / LaTeX.cpp
index 7a71b457c9d0ef41fcb93a4d4fe3636ec5508acd..6003772cbb4dd071a81f5bc13fe78e456ea74f9b 100644 (file)
 
 #include "BufferList.h"
 #include "LaTeX.h"
-#include "support/gettext.h"
 #include "LyXRC.h"
-#include "support/debug.h"
 #include "DepTable.h"
 
-#include "support/filetools.h"
+#include "support/debug.h"
 #include "support/convert.h"
+#include "support/FileName.h"
+#include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
-#include "support/lyxlib.h"
 #include "support/Systemcall.h"
 #include "support/os.h"
 
@@ -37,29 +37,10 @@ using boost::regex;
 using boost::smatch;
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::absolutePath;
-using support::bformat;
-using support::changeExtension;
-using support::contains;
-using support::FileName;
-using support::findtexfile;
-using support::getcwd;
-using support::makeAbsPath;
-using support::onlyFilename;
-using support::prefixIs;
-using support::quoteName;
-using support::removeExtension;
-using support::rtrim;
-using support::rsplit;
-using support::split;
-using support::subst;
-using support::suffixIs;
-using support::Systemcall;
-using support::trim;
-
 namespace os = support::os;
 
 // TODO: in no particular order
@@ -178,7 +159,7 @@ int LaTeX::run(TeXErrors & terr)
        bool rerun = false; // rerun requested
 
        // The class LaTeX does not know the temp path.
-       theBufferList().updateIncludedTeXfiles(getcwd().absFilename(),
+       theBufferList().updateIncludedTeXfiles(FileName::getcwd().absFilename(),
                runparams);
 
        // Never write the depfile if an error was encountered.
@@ -280,7 +261,7 @@ int LaTeX::run(TeXErrors & terr)
        if (head.haschanged(idxfile)) {
                // no checks for now
                LYXERR(Debug::LATEX, "Running MakeIndex.");
-               message(_("Running MakeIndex."));
+               message(_("Running Index Processor."));
                // onlyFilename() is needed for cygwin
                rerun |= runMakeIndex(onlyFilename(idxfile.absFilename()),
                                runparams);
@@ -354,7 +335,7 @@ int LaTeX::run(TeXErrors & terr)
        if (head.haschanged(idxfile)) {
                // no checks for now
                LYXERR(Debug::LATEX, "Running MakeIndex.");
-               message(_("Running MakeIndex."));
+               message(_("Running Index Processor."));
                // onlyFilename() is needed for cygwin
                rerun = runMakeIndex(onlyFilename(changeExtension(
                                file.absFilename(), ".idx")), runparams);
@@ -435,12 +416,14 @@ bool LaTeX::runMakeIndexNomencl(FileName const & file,
 {
        LYXERR(Debug::LATEX, "Running MakeIndex for nomencl.");
        message(_("Running MakeIndex for nomencl."));
+       string tmp = lyxrc.nomencl_command + ' ';
        // onlyFilename() is needed for cygwin
-       string const nomenclstr = " -s nomencl.ist -o "
+       tmp += quoteName(onlyFilename(changeExtension(file.absFilename(), nlo)));
+       tmp += " -o "
                + onlyFilename(changeExtension(file.toFilesystemEncoding(), nls));
-       return runMakeIndex(
-                       onlyFilename(changeExtension(file.absFilename(), nlo)),
-                       runparams, nomenclstr);
+       Systemcall one;
+       one.startscript(Systemcall::Wait, tmp);
+       return true;
 }
 
 
@@ -613,6 +596,12 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                        if (contains(token, "Rerun to get cross-references")) {
                                retval |= RERUN;
                                LYXERR(Debug::LATEX, "We should rerun.");
+                       // package clefval needs 2 latex runs before bibtex
+                       } else if (contains(token, "Value of")
+                                  && contains(token, "on page")
+                                  && contains(token, "undefined")) {
+                               retval |= ERROR_RERUN;
+                               LYXERR(Debug::LATEX, "Force rerun.");
                        } else if (contains(token, "Citation")
                                   && contains(token, "on page")
                                   && contains(token, "undefined")) {
@@ -764,12 +753,12 @@ bool handleFoundFile(string const & ff, DepTable & head)
        // (1) foundfile is an
        //     absolute path and should
        //     be inserted.
-       if (absolutePath(foundfile)) {
+       FileName absname(foundfile);
+       if (absname.isAbsolute()) {
                LYXERR(Debug::DEPEND, "AbsolutePath file: " << foundfile);
                // On initial insert we want to do the update at once
                // since this file cannot be a file generated by
                // the latex run.
-               FileName absname(foundfile);
                if (!insertIfExists(absname, head)) {
                        // check for spaces
                        string strippedfile = foundfile;
@@ -792,7 +781,7 @@ bool handleFoundFile(string const & ff, DepTable & head)
        }
 
        string onlyfile = onlyFilename(foundfile);
-       FileName absname(makeAbsPath(onlyfile));
+       absname = makeAbsPath(onlyfile);
 
        // check for spaces
        while (contains(foundfile, ' ')) {