]> git.lyx.org Git - lyx.git/commitdiff
replace bool-valued Pdflatex() by FLAVOR-valued getFlavor().
authorMartin Vermeer <martin.vermeer@hut.fi>
Thu, 27 Nov 2003 16:38:47 +0000 (16:38 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Thu, 27 Nov 2003 16:38:47 +0000 (16:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8141 a592a061-630c-0410-9148-cb99ea01b6c8

src/converter.C
src/converter.h
src/exporter.C

index 82f74c372a90b237e0fef5f1c1f51c21024d710d..1c56579c00222d4af050e41e67d741dcc619625f 100644 (file)
@@ -256,15 +256,16 @@ void Converters::sort()
 }
 
 
-bool Converters::usePdflatex(Graph::EdgePath const & path)
+OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path)
 {
        for (Graph::EdgePath::const_iterator cit = path.begin();
             cit != path.end(); ++cit) {
                Converter const & conv = converterlist_[*cit];
                if (conv.latex)
-                       return contains(conv.to, "pdf");
+                       if (contains(conv.to, "pdf"))
+                               return OutputParams::PDFLATEX;
        }
-       return false;
+       return OutputParams::LATEX;
 }
 
 
@@ -284,8 +285,7 @@ bool Converters::convert(Buffer const * buffer,
                return false;
        }
        OutputParams runparams;
-       runparams.flavor = usePdflatex(edgepath) ?
-               OutputParams::PDFLATEX : OutputParams::LATEX;
+       runparams.flavor = getFlavor(edgepath);
 
        string path = OnlyPath(from_file);
        Path p(path);
index b24f017e79d578c0b00d6ebd8aeea227a3cca781..801b4c3cbf542a2545324cd383974dfe110ee740 100644 (file)
@@ -13,6 +13,7 @@
 #define CONVERTER_H
 
 #include "graph.h"
+#include "outputparams.h"
 
 #include <vector>
 #include <string>
@@ -98,7 +99,7 @@ public:
        ///
        Graph::EdgePath const getPath(std::string const & from, std::string const & to);
        ///
-       bool usePdflatex(Graph::EdgePath const & path);
+       OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path);
        ///
        bool convert(Buffer const * buffer,
                     std::string const & from_file, std::string const & to_file_base,
index dc267c0349f35326f27c1af5842f0d4b25e3f207..a58c23e6a1cf4369f9fb64d9a6fb59998ae05ebe 100644 (file)
@@ -70,8 +70,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
                        Graph::EdgePath p =
                                converters.getPath(*it, format);
                        if (!p.empty()) {
-                               if (converters.usePdflatex(p))
-                                       runparams.flavor = OutputParams::PDFLATEX;
+                               runparams.flavor = converters.getFlavor(p);
                                backend_format = *it;
                                break;
                        }