]> git.lyx.org Git - lyx.git/blobdiff - src/Converter.cpp
- UI support for the LaTeX-package undertilde, fileformat change, fixed the remaining...
[lyx.git] / src / Converter.cpp
index 8c6c848dd8067a84ece32c690e0bf01b0daa235d..16ff6033d41d07c71e7cac8fe0c6966281e5a26d 100644 (file)
@@ -266,6 +266,8 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path)
                                return OutputParams::XETEX;
                        if (conv.latex_flavor == "lualatex")
                                return OutputParams::LUATEX;
+                       if (conv.latex_flavor == "dvilualatex")
+                               return OutputParams::DVILUATEX;
                        if (conv.latex_flavor == "pdflatex")
                                return OutputParams::PDFLATEX;
                if (conv.xml)
@@ -307,7 +309,8 @@ bool Converters::convert(Buffer const * buffer,
                        LYXERR(Debug::FILES, "No converter defined! "
                                   "I use convertDefault.py:\n\t" << command);
                        Systemcall one;
-                       one.startscript(Systemcall::Wait, command);
+                       one.startscript(Systemcall::Wait, command, buffer ?
+                                       buffer->filePath() : string());
                        if (to_file.isReadableFile()) {
                                if (conversionflags & try_cache)
                                        ConverterCache::get().add(orig_from,
@@ -337,7 +340,7 @@ bool Converters::convert(Buffer const * buffer,
        runparams.flavor = getFlavor(edgepath);
 
        if (buffer) {
-               runparams.use_japanese = buffer->bufferFormat() == "platex";
+               runparams.use_japanese = buffer->params().bufferFormat() == "platex";
                runparams.use_indices = buffer->params().use_indices;
                runparams.bibtex_command = (buffer->params().bibtex_command == "default") ?
                        string() : buffer->params().bibtex_command;
@@ -443,12 +446,15 @@ bool Converters::convert(Buffer const * buffer,
                        int res;
                        if (dummy) {
                                res = one.startscript(Systemcall::DontWait,
-                                       to_filesystem8bit(from_utf8(command)));
+                                       to_filesystem8bit(from_utf8(command)),
+                                       buffer ? buffer->filePath() : string());
                                // We're not waiting for the result, so we can't do anything
                                // else here.
                        } else {
                                res = one.startscript(Systemcall::Wait,
-                                               to_filesystem8bit(from_utf8(command)));
+                                               to_filesystem8bit(from_utf8(command)),
+                                               buffer ? buffer->filePath()
+                                                      : string());
                                if (!real_outfile.empty()) {
                                        Mover const & mover = getMover(conv.to);
                                        if (!mover.rename(outfile, real_outfile))
@@ -468,7 +474,8 @@ bool Converters::convert(Buffer const * buffer,
                                                " < " + quoteName(infile2 + ".out") +
                                                " > " + quoteName(logfile);
                                        one.startscript(Systemcall::Wait,
-                                               to_filesystem8bit(from_utf8(command2)));
+                                               to_filesystem8bit(from_utf8(command2)),
+                                               buffer->filePath());
                                        if (!scanLog(*buffer, command, makeAbsPath(logfile, path), errorList))
                                                return false;
                                }
@@ -612,7 +619,8 @@ bool Converters::runLaTeX(Buffer const & buffer, string const & command,
 
        // do the LaTeX run(s)
        string const name = buffer.latexName();
-       LaTeX latex(command, runparams, FileName(makeAbsPath(name)));
+       LaTeX latex(command, runparams, FileName(makeAbsPath(name)),
+                   buffer.filePath());
        TeXErrors terr;
        ShowMessage show(buffer);
        latex.message.connect(show);
@@ -691,43 +699,14 @@ Converters::getReachableTo(string const & target, bool const clear_visited)
 
 vector<Format const *> const
 Converters::getReachable(string const & from, bool const only_viewable,
-                        bool const clear_visited)
+                        bool const clear_visited, set<string> const & excludes)
 {
-       vector<int> const & reachables =
-               G_.getReachable(formats.getNumber(from),
-                               only_viewable,
-                               clear_visited);
-
-       return intToFormat(reachables);
-}
-
-
-vector<Format const *> const
-Converters::getReachable(string const & from, bool const only_viewable,
-                        bool const clear_visited, string const & exclude)
-{
-       vector<int> const & reachables =
-               G_.getReachable(formats.getNumber(from),
-                               only_viewable,
-                               clear_visited,
-                               formats.getNumber(exclude));
-
-       return intToFormat(reachables);
-}
+       set<int> excluded_numbers;;
 
-
-vector<Format const *> const
-Converters::getReachable(string const & from, bool const only_viewable,
-                        bool const clear_visited, vector<string> const & excludes)
-{
-       vector<int> excluded_numbers(excludes.size());
-
-       vector<string>::const_iterator sit = excludes.begin();
-       vector<string>::const_iterator const end = excludes.end();
-       vector<int>::iterator it = excluded_numbers.begin();
-       for ( ; sit != end; ++sit, ++it) {
-               *it = formats.getNumber(*sit);
-       }
+       set<string>::const_iterator sit = excludes.begin();
+       set<string>::const_iterator const end = excludes.end();
+       for (; sit != end; ++sit)
+               excluded_numbers.insert(formats.getNumber(*sit));
 
        vector<int> const & reachables =
                G_.getReachable(formats.getNumber(from),
@@ -799,6 +778,7 @@ vector<string> Converters::savers() const
        v.push_back("latex");
        v.push_back("literate");
        v.push_back("luatex");
+       v.push_back("dviluatex");
        v.push_back("lyx");
        v.push_back("xhtml");
        v.push_back("pdflatex");