From 3dfe7a4734fb5c4f4c8c5615ef9df38d882e5179 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Thu, 27 Nov 2003 16:38:47 +0000 Subject: [PATCH] replace bool-valued Pdflatex() by FLAVOR-valued getFlavor(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8141 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/converter.C | 10 +++++----- src/converter.h | 3 ++- src/exporter.C | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) 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; } -- 2.39.5