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
This commit is contained in:
Martin Vermeer 2003-11-27 16:38:47 +00:00
parent 0ca871014a
commit 3dfe7a4734
3 changed files with 8 additions and 8 deletions

View 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);

View 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,

View 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;
}