diff --git a/src/converter.C b/src/converter.C index 82f74c372a..1c56579c00 100644 --- a/src/converter.C +++ b/src/converter.C @@ -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); diff --git a/src/converter.h b/src/converter.h index b24f017e79..801b4c3cbf 100644 --- a/src/converter.h +++ b/src/converter.h @@ -13,6 +13,7 @@ #define CONVERTER_H #include "graph.h" +#include "outputparams.h" #include #include @@ -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, diff --git a/src/exporter.C b/src/exporter.C index dc267c0349..a58c23e6a1 100644 --- a/src/exporter.C +++ b/src/exporter.C @@ -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; }